"请指定npm或纱线包装"在尝试安装新的NPM包时,在PhpStorm / WebStorm中

时间:2016-12-25 05:39:12

标签: node.js intellij-idea npm phpstorm webstorm

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

enter image description here

重复设置一切看起来都不错:

enter image description here enter image description here

有什么建议去哪看?

2 个答案:

答案 0 :(得分:12)

您需要指定npm的路径。

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

enter image description here

答案 1 :(得分:0)

当我尝试从Linux上想法安装JavaScript库时,发生了类似的问题。我的想法是通过

  1. 安装Nodejs插件,然后Node.js and NPM设置可以显示在Languages & Frameworks

  2. Node.js and NPM设置下,在node interpreter项中单击...,将npm package:设置为/usr/share/npm

然后,我可以下载第三方JavaScript库。