Không serve được Vue do Node version cũ

Cài node lại bằng nvm

1. Install NVM (Node Version Manager)

To download the nvm install script run the following command:

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

The script will clone the nvm repository from Github to ~/.nvm and add the script Path to your Bash or ZSH profile.

=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

As the output above shows, you should either close and reopen your terminal or run the commands to add the path to nvm script to your current session.

To verify that nvm was properly installed type:

nvm --version
0.33.11

2. Install Node.js using NVM

Now that the nvm tool is installed we can install the latest available version of Node.js, by typing:

nvm install node
Downloading and installing node v11.0.0...
Downloading https://nodejs.org/dist/v11.0.0/node-v11.0.0-linux-x64.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v11.0.0 (npm v6.4.1)
Creating default alias: default -> node (-> v11.0.0)

Verify the Node.js version, by typing:

node --version
v10.1.0

Leave a Reply

You must be logged in to post a comment.