Skip to content

Latest commit

 

History

History
executable file
·
81 lines (68 loc) · 1.58 KB

nodejs.md

File metadata and controls

executable file
·
81 lines (68 loc) · 1.58 KB

installation

npm

proxy

npm config ls
npm config get https-proxy
npm config set https-proxy [url:port]

proxy in .npmrc

vim ~/.npmrc
proxy=http://user:[email protected]:8080/
https-proxy=http://user:[email protected]:8080/
;prefix=~/.npm-global

check installation

npm bin -g

permission denied for folder /usr/lib

# create new folder where node will place all packages
mkdir ~/.npm-global

# Configure npm to use new folder
npm config set prefix '~/.npm-global'

# update your settings in ```vim ~/.profile```
export PATH=~/.npm-global/bin:$PATH

print high level packages

npm list -g --depth=0

reinstall package globally

# npm search @angular
npm uninstall -g @angular/cli
npm cache clear --force
npm install -g @angular/cli 

build project ( install dependencies )

npm install
npm start

start from different folder, start with special marker

npm start --prefix /path/to/api "special_app_marker_for_ps_aux"

start with different port

  • package.json solution
 "scripts": {"start": "PORT=3310 node ./bin/www"},
  • npm solution
PORT=$PORT npm start --prefix $PROJECT_HOME/api

yarn package manager

yarn config list