“Please specify npm or yarn package” in PhpStorm/WebStorm when trying to install a new NPM package

时间:2020-12-25 13:22:52

Trying to add a new package I get the error below:

尝试添加新包我收到以下错误:

“Please specify npm or yarn package” in PhpStorm/WebStorm when trying to install a new NPM package

Going over settings everything looks good:

在设置上看起来一切都很好:

“Please specify npm or yarn package” in PhpStorm/WebStorm when trying to install a new NPM package “Please specify npm or yarn package” in PhpStorm/WebStorm when trying to install a new NPM package

Any suggestions where to look next?

有什么建议去哪看?

1 个解决方案

#1


11  

You need to specify the path to npm.

您需要指定npm的路径。

go to settings->Languages and Frameworks->Node.js and NPM and click on the ... alongside Node interpreter and then click on ... beside npm package and give the path to npm, in my case it is /usr/lib/nodejs/npm.

转到设置 - >语言和框架 - > Node.js和NPM,然后单击...旁边的节点解释器,然后单击npm包旁边的...并给出npm的路径,在我的例子中它是/ usr / LIB /的NodeJS / NPM。

“Please specify npm or yarn package” in PhpStorm/WebStorm when trying to install a new NPM package

#1


11  

You need to specify the path to npm.

您需要指定npm的路径。

go to settings->Languages and Frameworks->Node.js and NPM and click on the ... alongside Node interpreter and then click on ... beside npm package and give the path to npm, in my case it is /usr/lib/nodejs/npm.

转到设置 - >语言和框架 - > Node.js和NPM,然后单击...旁边的节点解释器,然后单击npm包旁边的...并给出npm的路径,在我的例子中它是/ usr / LIB /的NodeJS / NPM。

“Please specify npm or yarn package” in PhpStorm/WebStorm when trying to install a new NPM package