Setting Up Vue CLI on Ubuntu
Installing Node.js
Download the latest LTS vertion from the official Node.js website. Choose the Linux binaries archive, then extract it.
Move the extracted folder to the software installation directory:
mv node-v14.17.1-linux-x64 /usr/local/soft/
Create symbolic links for node and npm:
ln -s /usr/local/soft/node-v14.17.1-linux-x64/bin/node /usr/local/bin/node
ln -s /usr/local/soft/node-v14.17.1-linux-x64/bin/npm /usr/local/bin/npm
Verify the installations:
node -v
npm -v
Configuring cnpm (Optional)
Install cnpm to use the Taobao NPM mirror:
npm install -g cnpm --registry=https://registry.npmmirror.com/
If the mirror fails during installation, search for latest mirror URL and replace the one after
--registry=.
Create a symbolic link:
ln -s /usr/local/soft/node-v14.17.1-linux-x64/bin/cnpm /usr/local/bin/cnpm
Test the setup:
cnpm -v
Installing Vue CLI
Use npm to install @vue/cli globally:
npm install -g @vue/cli
Create a symbolic link for the vue command:
ln -s /usr/local/soft/node-v14.17.1-linux-x64/bin/vue /usr/local/bin/vue
Check the location:
whereis vue
Confirm the installed version:
vue -V