npm安装 n 报错,解决办法

因为安装项目依赖一直报错,往上查到说可以下载一个node版本控制工具,我选择了"n",但是输入命令行 npm install -g n一直报以下错误,

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@10.0.0: 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:\Users\yxy\AppData\Roaming\npm-cache_logs\2024-10-31T11_28_47_727Z-debug.log


报错图片.png

解决办法:

npm install -g n --force

成功!!!

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容