npm 更新报错

  1. 我在命令行执行 npm install -g n

  2. 出现:
    npm ERR! code EBADPLATFORM
    npm ERR! notsup Unsupported platform for n@2.1.12: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
    npm ERR! notsup Valid OS: !win32
    npm ERR! notsup Valid Arch: any
    npm ERR! notsup Actual OS: win32
    npm ERR! notsup Actual Arch: x64

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:UsersdallAppDataRoamingnpm-cache_logs2018-06-29T06_16_04_239Z-debug.log

  3. 如何解决?


忽然笑
浏览 1558回答 2
2回答

扬帆大鱼

window的话安装一个nvm,然后用nvm管理node版本;如果nvm使用过程中不能自动的话,手动下载多个node版本,手动切换 -- 不能好好用nvm再问我!因为大部分人都可以直接用nvm ls,nvm use -_-

慕田峪9158850

n does not work on Windows at the moment. Pull Requests are appreciatedn 不支持管理 win 上面的 node 版本
打开App,查看更多内容
随时随地看视频慕课网APP