npm install -g n
报错:
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@2.1.11: 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:\nodejs\node_cache\_logs\2018-06-04T09_21_44_010Z-debug.log
把命令行更改为:
npm install -g n --force
然并卵,查找问题发现在windows环境下n模块并不能管理node.js,转头使用nvm进行node.js版本管理。