1. View the version of the current node
node --version
Copy the code

2. Clear the NPM cache
npm cache clean -f
Copy the code
3. Version management tool name: n
npm install -g n
Copy the code

4. Update to the latest version
n latest
Copy the code

  • nCommon commands are as follows:nAll installed versions are listed for you to switch betweenn latestInstall the latest versionn stableInstall the latest stable versionn ltsInstall the latest long-term support versionN rm [Version number]Delete a versionn -hThe help commandN [Version number]Install the specified version of Node
5. Check whether the verification is successful
node -v
Copy the code