@alabebop/how-to-npm
v1.0.1
Published
Test npm project
Readme
Learn to npm!
This repository contains my learning notes of the NodeSchool workshop "How to npm"
If you get a .lock error trying to install a package, it may be caused by your previous installing packages in your home folder with
sudo, i.e. asroot. The fix is to change the owner of the.npmfolder back to yourself instead ofrootwith commandchown$ sudo chown -R my.user ~/.npmIf you install packages locally without first having them declared as dependencies in the
package.jsonfile, you are able to install them but will get anextraneouserror, which indicates that the package is extraneous to the project.To remove an extraneous package, use the npm command
prune$ npm prune <name>To install a package as well as having it declared as a dependency in your
package.jsonfile at the same time, use the--saveparameter when installing, or the--save-devparameter to have it declared as a devDependency$ npm install <package> --save$ npm install <package> --save-dev
