由于windows系统不支持n模块,所以你在网上查找的很多资料在使用的时候都会报错,例如
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@6.5.1: 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
原因:
node官方说明:(Unfortunately n is not supported on Windows yet. If you're able to make it work, send in a pull request!)
那么就无法根据命令行更新node.js,那怎么办呢?
最简单的方法就是直接去node官网下载:https://nodejs.org/zh-cn/
或者下载你需要的具体版本: