简体   繁体   English

将节点和节点模块更新到最新版本

[英]Update node and node modules to the latest version

I have a node setup - v0.10.26 [Latest available version: v0.12.7] And I have some 15 node modules, which I would like to update to the latest version. 我有一个节点设置-v0.10.26 [最新可用版本:v0.12.7]并且我有大约15个节点模块,我想将其更新为最新版本。

On running, npm outdated and npm outdated -g , I got the list of modules/packages - their current version and the latest version available. 在运行时, npm outdatednpm outdated -g ,我得到了模块/软件包的列表-它们的当前版本和可用的最新版本。 Documentation here: npm outdated 这里的文档: npm已过时

So how do I go about this? 那么我该怎么做呢? Should I first update my node? 我应该首先更新我的节点吗? And then update the modules? 然后更新模块?

Before updating node, I just tried this command npm update Documentation here: npm update 在更新节点之前,我只是尝试了此命令npm update这里的文档: npm update

On the terminal, I could see it updating the modules. 在终端上,我可以看到它正在更新模块。 But once the process was complete, I couldn't run npm commands anymore. 但是,一旦过程完成,我将无法再运行npm命令。 It's giving me this error: 这给了我这个错误:

Error: Cannot find module 'are-we-there-yet'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17) 

Don't know what went wrong. 不知道出了什么问题。 Or what I did wrong. 还是我做错了。

Please guide me through the steps to update my node and node modules to the latest version. 请引导我完成将节点和节点模块更新到最新版本的步骤。

Also after updating them, will my app run properly again? 另外,在更新它们之后,我的应用程序是否可以再次正常运行?

您可以使用nvm来管理Node版本,请查看我关于那一版本的文章: http ://mycodesmells.com/post/node-version-management/

我遇到了同样的问题,并且使用了本帖子第1段中提出的解决方案。

  1. > curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
  2. > nvm install 6.9.5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM