navi/cheats/javascript.cheat

39 lines
645 B
Text
Raw Normal View History

2019-10-14 16:51:58 +00:00
% npm, node, js
2019-09-24 12:59:32 +00:00
# initial new package
npm init
# initial immediately a new package
npm init -y
# install all dependencies packages
npm install
# install all dev dependencies packages
npm install --save-dev
# install a specified package
2019-09-25 00:08:16 +00:00
npm install <package_name>
2019-09-24 12:59:32 +00:00
# install a specified dev package
2019-09-25 00:08:16 +00:00
npm install <package_name> --save-dev
2019-09-24 12:59:32 +00:00
# install globally a specified package
2019-09-25 00:08:16 +00:00
npm install <package_name> -g
2019-10-14 16:51:58 +00:00
% nvm, node, js
# install a specified version of node
nvm install <version>
# list available versions
nvm ls-remote
# use installed node's version
nvm use <version>
# set a node's version as default
2019-10-14 16:54:09 +00:00
nvm alias default <version>