You need to specify the path to npm.
go to settings-> Languages ββand frameworks β Node.js and NPM and click ... along with the Node interpreter, and then click ... next to the npm package and specify the path to npm, in my case it is /usr/lib/nodejs/npm.

source
share