【问题标题】:NPM update errorNPM 更新错误
【发布时间】:2017-05-09 19:11:52
【问题描述】:

尝试升级我的 npm 但出现这些错误。 :S 任何人都可以将我指向正确的指南,这将是很棒的。

我正在运行 Windows 10

C:\Users\kavas>npm -v
2.14.12

C:\Users\kavas>npm cache clean

C:\Users\kavas>npm update -g --unsafe-perm node-red

> bcrypt@0.8.5 install C:\Users\kavas\AppData\Roaming\npm\node_modules\node-red\node_modules\bcrypt
> node-gyp rebuild

/
C:\Users\kavas\AppData\Roaming\npm\node_modules\node-red\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\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.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framew
ork 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it i
s installed elsewhere.  [C:\Users\kavas\AppData\Roaming\npm\node_modules\node-red\node_modules\bcrypt\build\binding.sln
]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\kavas\AppData\Roaming\npm\node_modules\node-red\node_modules\bcrypt
gyp ERR! node -v v4.2.4
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN deprecated i18next-client@1.10.3: you can use npm install i18next from version 2.0.0

【问题讨论】:

    标签: node.js git npm


    【解决方案1】:

    您可以使用以下命令更新 npm:

    npm install npm -g
    

    请注意,此命令将删除您当前版本的 npm。如果在 Mac 上,请确保使用 sudo npm install -g npm

    您还可以通过不带任何参数的npm update 更新所有过时的本地包,或者通过npm update -g 更新全局包

    如果你想更新 NODE-RED,试试这个命令:

    npm update -g node-red
    

    【讨论】:

      猜你喜欢
      • 2015-07-09
      • 2017-07-11
      • 2017-10-20
      • 2019-05-16
      • 2015-04-18
      • 2021-02-20
      • 1970-01-01
      • 1970-01-01
      • 2017-01-16
      相关资源
      最近更新 更多