nodejs Edit

Reding Book Edit

  • Node.js Recipes - Cory Gackenheimer

npm Edit

  • update npm version
>sudo npm update -g npm

npm initEdit

  • use npm init wizard for generate package.json
>mkdir node_test
>npm init

nvm Edit

install nvm Edit

  • manual install
git clone ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
    • you need to source it from your shell, I always add this line to my ~/.bashrc
 . ~/.nvm/
  • shell install
curl -o- | bash
wget -qO- | bash

sudo nvm Edit

  • For CentOS 6
  • add to current user .bashrc
vi ~/.bashrc
## add below
. /home/appdev/.nvm/
  • add to root .basrc
vi /root/.bashrc
## add below
. /home/appdev/.nvm/
  • sudo visudo
## add
Defaults    secure_path = + /usr/local/nodejs/nodejs/bin:/usr/local/bin
  • edit current user ~/.bash_profile
vi ~/.bash_profile
alias sudo='sudo env PATH=$PATH:$NVM_BIN'

nvm help Edit

  • nvm usage
nvm help

nvm list-remote , nvm listEdit

  • list all node version available for download
nvm ls-remote
  • list local version
nvm ls

= nvm common command Edit

  • install version
nvm install 4.1.0
nvm uninstall 4.1.0
nvm alias dev 4.1.0
nvm unalias dev
nvm run 4.1.0 app.js
nvm run dev app.js
nvm use 4.1.0

nvm default alias Edit

nvm alias default 0.12.7

nave , n Edit

  • nave is another node version management tool
>npm install -g nave
  • n is another node version management
>npm install -g n

package.json Edit

Community content is available under CC-BY-SA unless otherwise noted.