Installation on CentOS 7

curl -sL <> | sudo bash -
sudo yum install nodejs
node --version

Installation via NVM

curl -o- <> | bash
nvm --version.  # restart terminal
nvm install node

nvm install --lts
nvm install 8.12.0
nvm ls
nvm use 10.13.0
nvm alias default 10.13.0
nvm ls-remote


npm config set registry <> # or
npm install -g cnpm --registry=

or via alias:

alias cnpm="npm --registry= \\
--cache=$HOME/.npm/.cache/cnpm \\
--disturl= \\

# Or alias it in .bashrc or .zshrc
$ echo '\\n#alias for cnpm\\nalias cnpm="npm --registry= \\
  --cache=$HOME/.npm/.cache/cnpm \\
  --disturl= \\
  --userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc

Install development tools

To be able to build native modules from npm we will need to install the development tools and libraries:

sudo yum install gcc-c++ make

NPM commands

npm start --prefix subapp   # run `start` in subapp folder

# publish your package to npmjs
npm adduser
npm publish

Test package locally

Run the following commands to generate a package.