Skip to content

Instantly share code, notes, and snippets.

@fernandocanizo
Created May 23, 2015 03:43
Show Gist options
  • Save fernandocanizo/7c2740311ab2799b2ca7 to your computer and use it in GitHub Desktop.
Save fernandocanizo/7c2740311ab2799b2ca7 to your computer and use it in GitHub Desktop.
npm basics
# npm basics
- Install packages locally under node_modules directory:
```
npm install <package_name>
```
- Install packages globally, useful for applications:
```
sudo npm install -g <package_name>
```
- Install packages as dependencies: this will create a `package.json` file
```
npm install <package_name> --save
```
- Install packages as development dependencies, they will not be installed in production:
```
npm install <package_name> --save-dev
```
- Install packages as exact version dependencies
```
npm install <package_name> --save --save-exact
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment