Nodejs NPM Package Management configuration method and the common command introduction _node.js

Source: Internet
Author: User
Tags json

1. Enter NPM config ls-l to view the current directory settings

Copy Code code as follows:

; CLI configs
Long = True

; Builtin config C:\Program Files (x86) \NODEJS\NODE_MODULES\NPM\NPMRC
prefix = "C:\\USERS\\SAM\\APPDATA\\ROAMING\\NPM"

; Default values
Always-auth = False
Browser = "Start"
CA = "-----BEGIN Certificate-----\nmiichzccafaccqdauvz/khp8ejanbgkqhkig9w0baqufa
Dcbhzelmakga1uebhmc\nvvmxczajbgnvbagtaknbmrawdgydvqqhewdpywtsyw5kmqwwcgydvqqkewn
Ucg0x\nijagbgnvbastgw5wbsbdzxj0awzpy2f0zsbbdxrob3jpdhkxdjambgnvbamtbw5w\nbunbmrc
Wfqyjkozihvcnaqkbfghpqgl6cy5tztaefw0xmta5mduwmtq3mtdafw0y\nmta5mdiwmtq3mtdamighm
Qswcqydvqqgewjvuzelmakga1uecbmcq0exedaobgnv\nbactb09ha2xhbmqxddakbgnvbaota25wbte
Imcaga1uecxmzbnbtienlcnrpzmlj\nyxrlief1dghvcml0eteomawga1ueaxmfbnbtq0exfzavbgkqh
kig9w0bcqewcgla\naxpzlm1lmigfma0gcsqgsib3dqebaquaa4gnadcbiqkbgqdli4tiqpprw+acw9g
E\nogbljzwk5f8nnkclk629pv5yjpqks3denexayogdcyaf0hd0zk8ztp+zslandkoz\ngn2u181kgpr
Gkaxp6du6byojdwmtly6+ad1layt0m64fersphw/hjd3d+ix4amol\ny0hdbt5m1zgh6sjz3zqxavhhl
Qidaqabma0gcsqgsib3dqebbquaa4gbac4ysdbc\nl7w1wplmtlgeq/yumluf6jy/vr+crp4h+uzl+iq
Pcv8ffxsye7dhf/bmwteupbkv\nynl18lipt2jsvr3v6oahareotvdjqhxddpe5holns6eqd1/xez7sb
1yhqkjtvurl\nznufy1jf1r0ldegea+0isck7s+xsh9rqd2op\n-----End Certificate-----"
cache = "C:\\users\\sam\\appdata\\roaming\\npm-cache"
Cache-max = null
Cache-min = 0
color = True
Coverage = False
depth = null
Description = True
dev = False
Editor = "notepad.exe"
force = False
git = "git"
Global = False
GlobalConfig = "C:\\Program Files (x86) \\NODEJS\\ETC\\NPMRC"
Globalignorefile = "C:\\Program Files (x86) \\nodejs\\etc\\npmignore"
Group = 0
Ignore = ""
Init-module = "C:\\users\\sam\\.npm-init.js"
Init.version = "0.0.0"
Init.author.name = ""
Init.author.email = ""
Init.author.url = ""
JSON = False
link = False
loglevel = "http"
; Long = False (overridden)
Message = '%s '
Node-version = "0.8.0"
Npaturl = "http://npat.npmjs.org/"
Npat = False
Onload-script = null
OUTFD = 1
Parseable = False
Pre = False
; prefix = "C:\\Program Files (x86) \\nodejs" (overridden)
Production = False
Proprietary-attribs = True
Proxy = null
Https-proxy = null
User-agent = "npm/1.1.32 node/v0.8.0"
Rebuild-bundle = True
Registry = "https://registry.npmjs.org/"
Rollback = True
Save = False
Save-bundle = False
Save-dev = False
Save-optional = False
searchopts = ""
Searchexclude = null
Searchsort = "Name"
Shell = "C:\\windows\\system32\\cmd.exe"
Strict-ssl = True
Tag = "latest"
TMP = "C:\\users\\sam\\appdata\\local\\temp"
Unicode = True
Unsafe-perm = True
Usage = False
user = 0
Username = ""
Userconfig = "C:\\USERS\\SAM\\.NPMRC"
Userignorefile = "C:\\users\\sam\\.npmignore"
Umask = "022"
Version = False
Versions = False
Viewer = "Browser"
Yes = null
_exit = True

2. For a particular setting, you can use the

Copy Code code as follows:

NPM Config Set property Name property value

The way to configure it.

For example:

Copy Code code as follows:
NPM config set prefix "C:\123\"

3. Read one of the configuration

Copy Code code as follows:
npm config get prefix


4.NPM of COMMON commands
Copy Code code as follows:

NPM Install XXX Installation module
NPM Install xxx@1.1.1 installs the 1.1.1 version of XXX
NPM Install XXX-G installs modules into the global environment.
NPM LS View the installed modules and dependencies
NPM LS-G View the globally installed modules and dependencies
NPM uninstall XXX (g) Uninstall module
NPM Cache Clean Cleanup caching
NPM Help XXX View assistance
NPM View moudlename Dependencies View package dependencies
NPM View Modulenames View the node module's Package.json folder
NPM View ModuleName labelname View the contents of a label under the Package.json folder
NPM View ModuleName Repository.url View the source file address of the package
NPM View ModuleName Engines View the version of node on which the package depends
NPM Help Folders view all the folders that NPM uses
NPM rebuild ModuleName is used to rebuild after package content is changed
NPM outdated check that the package is obsolete, and this command lists all outdated packages that can be updated in a timely manner
NPM Update modulename Update node module

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.