Upgrade Node.js to the latest version

This article was translated from: Upgrading Node.js to latest version

So, I have Node.js installed and now when I tried to install Mongoosejs I got an error telling me that I don't have the needed version of Node.js (I have v0.4.11 and v0.4.12 is needed). So , I have installed Node.js, and now when I try to install Mongoosejs, an error message appears, telling me that I do not have the required version of Node.js (I need v0.4.11 and v0.4.12).

How can I upgrade to this version? How can I upgrade to this version ? I suppose I just could install it again with the latest version, but I don't want to do it before I'm sure that my project folders in the folder "node" won't be deleted. I think I can install the latest again Version, but I did n’t want to do this until I was sure that the project folder in the “nodes” folder would not be deleted.


#1st Floor

Reference: https://stackoom.com/question/gHDy/ Upgrade Node-js to the latest version


#2nd Floor

Linux/Mac: Linux / Mac:

The module nmakes version-management easy: modules nmake version management easy:

sudo npm install n -g

For the latest stable version: For the latest stable version:

sudo n stable

For the latest version: For the latest version:

sudo n latest

Windows: Windows:

REINSTALL the Node at The .msi from the Just in at The Windows from the Node Website . Just from the Web site node in Windows .msi reinstall node.


#3rd floor

2019 Solution Without a using sudo! 2019 solution does not use sudo!

The current stable "LTS" version of node is 12.13.1 ( 2019-11-26 ) see : nodejs.org for latest . The current stable node "LTS" version is 12.13.1 ( 2019-11-26 ), regarding the latest For information, see : nodejs.org .

1 the STEP - the Get NVM (the Node Manger Version) Step 1 - get NVM (Node Manager version)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash

You're IF Curious the About the Command at The Installation the Read at The Source code If you install command curious , please read the source code
... the ITS been reviewed by 'several' node.js Security Experts ... it has made a number of node.js security The expert conducted a review

2 STEP - the Install The Version of node.js you need Step 2 - Installation node.js version required

Once you've got NVM you can install a specific version of Node.js using the nvm command: After obtaining NVM , you can use the nvm command to install a specific version of Node.js:

nvm install v12.13.1

Note : you may need to close & re-open your terminal window for nvmcommand to be available. Note : You may need to close and reopen the terminal window to make the nvmcommand available.

You should expect to see something like this in your terminal: You should expect to see something like this in your terminal :

Now using node v12.13.1

3 the STEP - Enjoy at The REST of your Day! Step 3 - Enjoy your rest of the day!

Yes , IT's that the Easy and The require DID not sudo! Yes , that is so simple , no sudo!
Now Please Upvote the this ( SO CAN Others Avoid sudo-installing Things! ) Now please vote this ( so others can avoid sudo-installing !! )
and have have A Lovely Day Writing node.js code! And happily write the code node.js !

Microsoft Windows User ? Microsoft Windows User ? Use : https://github.com/coreybutler/nvm-windows Use : https : //github.com/coreybutler/nvm-windows

tl;dr tl; dr

Review of the node mailing list indicates that using NVM ( Node Version Manager ) is the preferred way to manage your nodejs versioning / upgrading. Viewing the node mailing list indicates that using NVM ( node version manager ) is to manage the Node.js version / upgrade The preferred method. see: github.com/nvm-sh/nvm see: github.com/nvm-sh/nvm

NVM is considered " better " than N because the verbose commands mean is much easier to keep track of what you are doing in your Terminal / SSH Log. Because verbose commands mean that it is easier to track you in your terminal / SSH log in What NVM is considered " better " of N and more. Its also faster , saves kittens by not requiring sudo and is used by the team at NPM the node.js security experts ! It is also faster and does not need sudo to save kittens , NPMTeam uses node.js security experts !


#4th floor

via npm: via npm:

# npm cache clean -f
# npm install -g n
# n stable

and also you can specify a desired version: and you can also specify a desired version :

# n 0.8.21

reference Reference


#5th Floor

my 2c: My 2c:

I tried both with n and with nvm on Linux Ubuntu 12.04 LTS, in order to update node from v0.8.25 to v0.10.22. In order to update the node from v0.8.25 to v0.10.22, I tried both on Linux Ubuntu 12.04 LTS N and nvm.

The first one was successfully completed, but the command 'which node' resulted in the old v0.8.25. The first one was successfully completed, but the command "which node" resulted in the old v0.8.25.
The second one was successfully completed and the same command resulted in v.0.10.22. The second one was successfully completed and the same command resulted in v.0.10.22.


#6th floor

Upgrading node.js to the latest version on Windows upgrade to the latest version of Windows on node.js

  1. Install chocolatey if you haven't already: Installing Chocolatey If you haven't already installed Chocolatey, please do the following : Install Chocolatey

  2. From the command prompt, type At the command prompt, type

    cup nodejs

(Which IS equivalent to Typing choco upgrade nodejs- Assumes you already have have the Node Installed) (which is equivalent to type choco upgrade nodejs- assuming you have already installed the node)

NOTE: You may need to run cinst nodejs.installfor chocolatey to register your existing installation. Note: You may need to run cinst nodejs.installto obtain Chocolatey to register your existing installation. (thanks for the comment, @mikecheel) (Thanks for your comment, @mikecheel)


Installing node.js on Windows is installed on Windows node.js

If you have never installed node, you can use chocolatey to do that as well. If you have never installed node, you can also use Chocolatey to complete it. Install chocolatey (see step 1 above). Install chocolatey (see step 1 above ). Then from a command prompt, type: Then at the command prompt, type:

cinst nodejs.install

Chocolatey Gallery Node JS (Install) Chocolatey Gallery Node JS(安装)


Installing a specific version of node on Windows with chocolatey using Chocolatey to install a specific version of node on Windows

cinst nodejs.install -Version 0.10.26

Published 0 original articles · praised 8 · 30,000+ views

Guess you like

Origin blog.csdn.net/asdfgh0077/article/details/105561622