【问题标题】:NPM installation Error in windowsWindows中的NPM安装错误
【发布时间】:2016-08-27 07:14:51
【问题描述】:

我的 nodejs 最近损坏并重新安装。现在,我在安装 npm 依赖项时遇到了这个错误。我错过了什么?

C:\Projects\xyz>npm i
/
> bufferutil@1.2.1 install C:\Projects\basic-vplex-sizer-ui\node_modules\bufferutil
> node-gyp rebuild


C:\Projects\basic-vplex-sizer-ui\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Users\ham13\AppData\Roaming\nvm\v4.4.3\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v120 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, please install v120 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Projects\basic-vplex-sizer-ui\node_modules\bufferutil\build\bufferutil.vcxproj]

更多信息:

【问题讨论】:

  • 供以后参考。将错误消息复制出来并将其放在文本中,这样其他人在搜索相同错误时更容易找到您的问题:)

标签: node.js configuration npm msbuild


【解决方案1】:

如果Node.js 版本已更改,请检查node -v,如果仍然出现错误,则必须执行npm rebuild,然后删除node_modules 文件夹并执行npm install

希望有效。

【讨论】:

  • 我删除了 nodejs,清除了所有缓存。也安装了视觉工作室。从 npm 全局设置 msvs 路径。我已经在全球范围内安装了 node-gyp。仍然存在错误
猜你喜欢
  • 1970-01-01
  • 2017-11-09
  • 1970-01-01
  • 1970-01-01
  • 2015-09-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-30
  • 2012-02-09
相关资源
最近更新 更多