如何覆盖 npm 安装版本检查失败?
有没有办法从命令行(npm install 命令
)覆盖 npm 对 packages.json 文件的版本检查?
我想尝试安装/运行一个包,即使它与我的 node.js 版本不匹配。
这是我收到的错误:
npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: [email protected]
npm ERR! Required: {"node":"0.4.x"}
npm ERR! Actual: {"npm":"1.0.8","node":"v0.5.0-pre"}
谢谢
Is there a way to override npm's version checking against a packages.json file from command line (npm install command
)?
I would like to try and install/run a package even though it doesn't match my node.js version.
This is the error I am getting:
npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: [email protected]
npm ERR! Required: {"node":"0.4.x"}
npm ERR! Actual: {"npm":"1.0.8","node":"v0.5.0-pre"}
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以做的是转到 github package 并更新
package.json
。然后直接安装到本地就可以了。但大多数时候这些版本号的存在是有原因的。 node.js api 有时会发生变化(我相信 0.5.0-pre 发生了变化,因为 socket.io 也因 0.5.0-pre 而失败)。例如,如果您安装 nvm,nave 你可以轻松地并排保存多个版本的node.js。
What you could do is go to github package and update the
package.json
. Then just install it locally. But most of the times these version numbers are there for a reason. The node.js api changes sometimes(I believe 0.5.0-pre changed, because socket.io also fails with 0.5.0-pre).If you for example install nvm, nave you can keep several version of node.js side-by-side easily.
如果一切都失败了,您仍然可以手动下载并复制 node_modules 文件夹中的文件
If all else fails you could still manually download and copy the files in your node_modules folder