Is package.json supposed to be manually edited? Couldn\'t a program like npm just look through the files, see the \"require\" statements, and then use that to put the necess
Command line:
npm init
will create package.json file
To install , update and uninstall packages under dependencies into package.json file:
Command line :
npm install @* --save
will automatically add the latest version for the package under dependencies into package.json file
EX:
npm install node-markdown@* --save
Command line:
npm install --save
also will automatically add the latest version for the package under dependencies into package.json file
if you need specific version for a package use this Command line:
npm install @ --save
will automatically add specific version of package under dependencies into package.json file
EX:
npm install koa-views@1.0.0 --save
if you need specific range of version for a package use this Command line:
npm install @
will automatically add the latest version for the package between range of version under dependencies into package.json file
EX:
npm install koa-views@">1.0.0 <1.2.0" --save
For more details about how to write version for package npm Doc
Command line:
npm update --save
will update packages into package.json file and will automatically add updated version for all packages under dependencies into package.json file
Command line:
npm uninstall --save
will automatically remove package from dependencies into package.json file and remove package from node_module folder