Skip to content

Instantly share code, notes, and snippets.

@dohaivu
Last active May 26, 2018 02:24
Show Gist options
  • Save dohaivu/a63eecb77be5621131b05866e07c3e01 to your computer and use it in GitHub Desktop.
Save dohaivu/a63eecb77be5621131b05866e07c3e01 to your computer and use it in GitHub Desktop.
[npm commands] #nodejs

Install node gyp

https://github.com/mafintosh/node-gyp-install
npm install -g node-gyp-install
node-gyp-install

Version

version Must match version exactly
>version Must be greater than version
>=version etc
<version
<=version
~version 1.2.x
^version 1.x.x
1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
http://... See 'URLs as Dependencies' below
* Matches any version

Common commands

npm update npm -g # update npm

# install
curl https://npmjs.org/install.sh | sh

npm root # get the root folder where packages are installeds

Publish

npm login # login account

npm publish # push to registry

# update
npm version <update_type> # increase version, update_type: patch, minor, or major.
npm publish

Error

# Error: ENOENT: no such file or directory, scandir 
node node_modules/node-sass/scripts/install.js
npm rebuild node-sass

node node_modules/pngquant-bin/lib/install.js
node node_modules/optipng-bin/lib/install.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment