无法安装npm

时间:2016-06-17 17:32:20

标签: node.js visual-studio visual-studio-cordova taco

我更新到TACO 10& VS 2015 2.由于路径较长,我收到以下错误。

1>  Installing npm 2.14.9. This could take a few minutes...
1>  Failed: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

有没有办法告诉VS使用全局安装的npm。我尝试安装.NET Web Development and Tools Blog和c hanging the path orders on the External Web Tools options

我还尝试取消选中使用沙箱节点,但VS仍尝试安装npm。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

Windows不喜欢npm在npm v1.x&中执行嵌套依赖关系树的方式。 v2.x,最终他们会抛出这个错误。嵌套的依赖树将创建非常长的路径名,并在Windows中达到上限。

你应该使用npm v3.x,npm使用v3.x转到flat dependency structure,这个问题就会消失。