1-npm - n
常见报错#
windows安装n报错#
D:\downloads\demo3>npm install -g n
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@9.0.0: wanted {"os":"!win32"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: undefined
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\zhangkai\AppData\Local\npm-cache\_logs\2022-09-19T12_27_45_738Z-debug-0.log
原因:该npm模块在windows下不能安装,在Linux、Mac下可以。
解决办法:
D:\downloads\demo3>npm install -g n --force
npm WARN using --force Recommended protections disabled.
added 1 package in 642ms
加上-force就可以了,force是强制的意思,强制安装就可以了。可以达到目的。
参考:https://www.csdn.net/tags/NtDaUg2sMTc1OC1ibG9n.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步