【问题标题】:Failed to install npm安装 npm 失败
【发布时间】:2016-06-17 17:32:19
【问题描述】:

我更新到 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 和 changing the path orders on the External Web Tools options

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

有什么想法吗?

【问题讨论】:

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


【解决方案1】:

Windows 不喜欢 npm 在 npm v1.x 和 v2.x 中执行嵌套依赖树的方式,最终它们会抛出此错误。嵌套的依赖树会创建很长的路径名,并且会在 windows 中达到上限。

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

【讨论】:

  • 我已在全球范围内安装了 v3.x,但 VS Taco 尝试使用 2.14.9。安装 npm 时出现错误。
猜你喜欢
  • 1970-01-01
  • 2017-02-04
  • 2012-12-07
  • 2018-06-06
  • 2020-10-31
  • 2017-12-03
相关资源
最近更新 更多