如何将此node.js模块降级到特定版本并阻止以后自动升级? [英] How to downgrade this node.js module to specific version and prevent automatic upgrade later?

查看:420
本文介绍了如何将此node.js模块降级到特定版本并阻止以后自动升级?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用node.js Nodemailer模块并遇到以下错误;

I am using node.js Nodemailer module and encountered the following error;


[错误:不支持的配置,将Nodemailer降级到v0。 7.1或
请参阅迁移指南
https://github.com/ andris9 / Nodemailer#migration-guide]

我查看了我的package.json并意识到它是nodemailer:^ 1.8.0,版本。

I looked at my package.json and realize that it is "nodemailer": "^1.8.0", version.

如何降级到v0.7.1并阻止自动升级以后当我运行 npm update

How do I downgrade to v0.7.1 and prevent automatic upgrade later when I run npm update?

推荐答案

如果您确切需要v0.7.1,请使用nodemailer:0.7.1,删除 node_modules 下的 nodemailer 并运行 npm install 再次。

If you need exactly v0.7.1, use "nodemailer": "0.7.1", delete nodemailer under node_modules and run npm install again.

另一种方法是运行命令:

Another way to do this is to run the command:

npm remove nodemailer
npm install nodemailer@0.7.1 --save

这篇关于如何将此node.js模块降级到特定版本并阻止以后自动升级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆