parent
b3a66fe97f
commit
def4349e52
@ -0,0 +1,64 @@
|
||||
# Node Package Manager (NPM) quick cheatsheet
|
||||
|
||||
## get help
|
||||
```
|
||||
npm -h
|
||||
```
|
||||
## get help on a command
|
||||
```
|
||||
$ npm <command> -h
|
||||
```
|
||||
eg :
|
||||
```
|
||||
$ npm init -h
|
||||
```
|
||||
|
||||
## init a project (create package.json)
|
||||
```
|
||||
$ npm init
|
||||
```
|
||||
|
||||
## install module globally (adds to package.json)
|
||||
```
|
||||
npm i -g saxon-js
|
||||
```
|
||||
or long version
|
||||
```
|
||||
npm install -g saxon-js
|
||||
```
|
||||
|
||||
|
||||
## install module localy (adds to package.json)
|
||||
```
|
||||
npm i saxon-js
|
||||
```
|
||||
|
||||
## install module localy and do not add to package json
|
||||
```
|
||||
npm i --no-save saxon-js
|
||||
```
|
||||
|
||||
## check all modules installed localy
|
||||
```
|
||||
$ npm ls
|
||||
```
|
||||
|
||||
## check all modules installed globaly
|
||||
```
|
||||
$ npm ls -g
|
||||
```
|
||||
|
||||
## uninstall local module
|
||||
```
|
||||
npm uninstall saxon-js
|
||||
```
|
||||
Shorthand `u` does NOT work
|
||||
|
||||
## uninstall global module
|
||||
```
|
||||
npm uninstall -g saxon-js
|
||||
```
|
||||
|
||||
## sources
|
||||
- https://docs.npmjs.com/cli/v6/commands/npm-install
|
||||
- https://www.tutorialspoint.com/nodejs/nodejs_npm.htm
|
Loading…
Reference in new issue