NPM
npm is a package manager for
JavaScript, and is default for Node.js
npm install package -g
fixing installation issue
- changing the directory as ownerwhoami – get user namesudo chown user_name directorynpm config get prefixsudo chown -R user_name all directory(*** /usr/local/lib,/usr/local/bin,/usr/local/share)
-
mkdir /users/user_name/npm-globalnpm config set prefix /users/user_name/npm-globalnpm install -g newpackagetrying to access newpackage cmd in terminal won't not working for that
Install npm package locally – not
executable
Install npm package globally –
executable
package.json name,version – required
dependencies install- npm install
package - -save save the dependencies in package.json
update local package – npm update
list out packages using - npm ls
check outdated packages – npm
outdated
uninstall package – npm uninstall
package
uninstall package and remove from
package.json dependencies – npm uninstall package –save
remove unwanted package download for
project (dependencies not exist in package.json)-
npm prune
installing npm package globally – npm
install package -g
note :error while installing use sudo
npm install package -g
update also
npm install -g jshint
check outdated
npm outdated -g –depth=0
uninstall package
npm uninstall -g package
export.function
npm publish
semantic version
npm version patch
npm version minor
npm version major
minor version release update - npm
install packag@1.x – minor version
No comments:
Post a Comment