Node package manager
mkdir nameFolder
cd nameFolder
git init
- create
.gitignore
and ignore/node_modules/
- to generate package.json
npm init
-npm init -yes
-npm init -y
- Can use again
npm init
when already have package.json to update or add -
npm set init.author.name "Carlos Jaramillo"
-
npm set init.author.email "cejaramillof@unal.edu.co"
-
npm set init.license "MIT"
npm list -g --depth 0
show global installedsnpm i dependencie
since npm 5 without flag, per default add like prodDependencienpm
-
install dependencie
i
for install dependencie (after edit package.json you require install for apply updates)
-
-
--save
-S
for prod dependencies
-
-
-
--save-dev
-D
for dev dependencies
-
-
-
--save-exact
-E
for exact version without^
-
-
-
--save-optional
-O
for optional dependencies
-
-
-
-g
for install global package (require permissions)
-
-
-
--dry-run
to simulate install and print output
-
-
-
--force
-f
for force install the latest version from npm servers
-
-
-
@specific.version
@latest
for indicate specific version of dependencie
-
-
uninstall dependencie
for uninstall package
-
uninstall dependencie --no-save
to uninstall without update package.json
-
list
for dependencies on current project
-
outdate
to show current outdated packages
-
outdate --dd
to show current output of outdated packages
-
update
to update all current outdated packages
-
update package
to update specific package
-
-
--depth 2
to say specific depth to apply update
-
### Dependencie version (3.9.2) - (major.minor.patch) ^ caret (for stay updating minor and patch) ~ tilde (for stay updating only patch) #### major
- breaking change
- backwards compatible new functionality
- old funcitonality deprecated, but operational
- large internal refactor
- bug fixes
Commands to execute comands from terminal
npm run command
to run command&&
to run multiple commands From terminal--
to send args--dd
to active verbose mode to output changes and debug
node_modules/.bin/dependencie
npm cache clean --force
orrm -rf node_modules/
sudo npm install -g rimraf
-
rimraf node_modules
### Verify cache
npm cache verify
npm audit
show vulnerabilities
npm audit --json
show more details about vulnerabilitie
npm audit fix
fix vulnerabilities
snky.io usted to stay analyzing update dependencies
sudo npm link
run at base of dependencie (where are package.json)
sudo npm install -g path
path at where are package.json
npm adduser
npm publish
npm version patch
npm version minor
npm version major
- npm (compare package.json with node_modules)
- npm intellisense (helper, paths imports)
Nodemon is used for generate a demon to stay watching changes or values to run a command.
-v
: --version-h
: -?, --help, -H: --usage-s
: --silent: --loglevel silent-q
: --quiet: --loglevel warn-d
: --loglevel info-dd
: --verbose: --loglevel verbose-ddd
: --loglevel silly-g
: --global-C
: --prefix-l
: --long-m
: --message-p
: --porcelain: --parseable-reg
: --registry-f
: --force-desc
: --description-S
: --save-P
: --save-prod-D
: --save-dev-O
: --save-optional-B
: --save-bundle-E
: --save-exact-y
: --yes-n
: --yes falsell
and la commands: ls --long