Node. js unpretentious npm

Source: Internet
Author: User
Tags node server
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 )!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.