Skip to content

Commit

Permalink
Add npm ☑
Browse files Browse the repository at this point in the history
  • Loading branch information
spences10 committed May 19, 2017
1 parent 3ca1a2a commit c8d20ea
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ A place for all my cheat sheets to live!

- **[Git](git.md#useful-git-commands)**

- **[npm](npm.md#npm-plz!)**
81 changes: 81 additions & 0 deletions npm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# NPM plz!

A list of terminal commands and flags to help me use `npm`

## enable npm cache

Super charge `npm`

```
npm config set cache-min 9999999
```

## install package.json dependencies

```
npm install
```

**Shorthand**

```
npm i
```

## add standard by feross

```
npm install standard -g
```

## update npm

```
npm install -g npm@latest
```

## flags

`-S` is the same as `--save`
`-D` is the same as `--save-dev`

## installed version

`npm list` for local packages or `npm list -g` or `npm list -g --depth=0` for globally installed packages.

## Node Version Manager `nvm`

Say you want to install Node v6.9.1 you would write on the terminal:

```
nvm install 6
```

If you have multiple versions of Node.js installed on your workspace, you can switch to a specific version by writing:

```
nvm use 0.10.40
```

Making a node version default

In order to set a default version of node for your workspace, just type:

```
nvm alias default 6
```

Where 6 was the version you wanted to be used as default.

## Uninstall global package

```
npm -g uninstall <name> --save
```

## Upgrade NPM on Windows

```shell
npm-windows-upgrade
```

0 comments on commit c8d20ea

Please sign in to comment.