1 Download node-v0.10.24.tar.gz https://nodejs.org/dist/v4.2.1/
2 Unzip to /home/johnny/tools/nodejs/
3 sudo vim /etc/profile join
export PATH=/home/johnny/tools/nodejs/bin/:$PATH
export NODE_PATH=/home/johnny/tools/nodejs:/home/johnny/tools/nodejs/lib/node_modules
4 Through npm config ls -l
Modify the file pointed to by userconfig, add prefix and cache to point to a custom directory
Such as modifying /home/johnny/.npmrc
prefix=/home/johnny/tools/nodejs/
cache=/home/johnny/tools/nodejs/lib/cache/
test
npm i -g grunt-cli
grunt
Now that Node.js is chosen, it is necessary to build a development environment. The following is to build a Node.js development environment with Ubuntu 14.04 as the development platform:
Install Node.js:
The version of Node.js that comes with Ubuntu 14.04 is too old, and I tried the installation and it was not successful, so I need to add the Node.js PPA to install the latest version of Node.js, and execute it in the terminal:
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
After the installation is complete, execute the node -v command to see if Node.js is installed successfully.
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js (press enter again and then Ctrl+c)
sudo apt-get update
sudo apt-get install nodejs
Through npm config ls -l
Modify the file pointed to by userconfig, add prefix and cache to point to a custom directory
Recommended Posts