鍍金池/ 問答/Linux/ npm 更新報(bào)錯(cuò)

npm 更新報(bào)錯(cuò)

  1. 我在命令行執(zhí)行 npm install -g n
  2. 出現(xiàn):
    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. 如何解決?
回答
編輯回答
墻頭草
n does not work on Windows at the moment. Pull Requests are appreciated
n 不支持管理 win 上面的 node 版本
2018年9月6日 05:28
編輯回答
爛人

window的話安裝一個(gè)nvm,然后用nvm管理node版本;
如果nvm使用過程中不能自動(dòng)的話,手動(dòng)下載多個(gè)node版本,手動(dòng)切換 -- 不能好好用nvm再問我!因?yàn)榇蟛糠秩硕伎梢灾苯佑胣vm ls,nvm use -_-

2018年4月12日 07:57