Then enter as required until Isthisok? (Yes) Key Points for learning to generate a package. json File
View version
Upgrade
Installation Module
Modules
View the module list
Uninstall Module
Update Module
Search Module
Create a module
Release Module
REPL
Npm Package Manager
View version
[code]npm -v
Npm upgrade
Windows
[code]npm install npm -g
In lunix
[code]sudo npm install npm -g/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.jsnpm@2.14.2 /usr/local/lib/node_modules/npm
Installation module-express Module
[code]npm install express
The installation directory is in the node_modules folder of the current project.
Modules
[code]var express = require('express');
View installed modules
[code]npm ls
Uninstall the installed Module
[code]npm unstall express
Update Module
[code]npm update express
Search Module
[code]npm search express
Create a module
Terminal command:
npm init
Then enter as required until it Is this OK? (Yes)
Finally, the package. json file is generated.
[Code] {"name": "wolf", // Module name "version": "1.0.0", // version "description": "haihan wolf club ", // description // The main field is a module ID, which is a main project pointing to your program. // If your package is named express, then the user installs it and then require ("express "). "Main": "index. js "," dependencies ": {// dependency package list" express ":" ^ 4.14.0 "}," devDependencies ":{}," scripts ": {// test "test": "make test", "start": "node server. js "}," repository ": {// github account" type ":" git "," url ":" http://lamport.me/club "}," author ":" zhang ", // Author "license": "ISC" // passport}
Registered User
[code]npm adduser
Release Module
[code]npm publish
Node. js REPL (Read Eval Print Loop) Interactive Interpreter
Start node
Exit twice ctrl + c
The above is the content of Node. js's unpretentious npm. For more information, see PHP's Chinese website (www.php1.cn )!