npm & config settings
npm & config settings
how to check npm config settings
https://docs.npmjs.com/cli/config
$ npm config list
$ npm config list --json
$ npm config list -l
$ npm config list -l --json
$ npm config list --json
{
"json": true,
"user-agent": "npm/6.4.1 node/v10.15.3 win32 x64",
"metrics-registry": "https://registry.npmjs.org/",
"scope": "",
"prefix": "C:\\Users\\xgqfrms\AppData\\Roaming\\npm",
"access": null,
"allow-same-version": false,
"always-auth": false,
"also": null,
"audit": true,
"audit-level": "low",
"auth-type": "legacy",
"bin-links": true,
"browser": null,
"ca": null,
"cache": "C:\\Users\\xgqfrms\\AppData\\Roaming\\npm-cache",
"cache-lock-stale": 60000,
"cache-lock-retries": 10,
"cache-lock-wait": 10000,
"cache-max": null,
"cache-min": 10,
"cert": null,
"cidr": null,
"color": true,
"depth": null,
"description": true,
"dev": false,
"dry-run": false,
"editor": "notepad.exe",
"engine-strict": false,
"force": false,
"fetch-retries": 2,
"fetch-retry-factor": 10,
"fetch-retry-mintimeout": 10000,
"fetch-retry-maxtimeout": 60000,
"git": "git",
"git-tag-version": true,
"commit-hooks": true,
"global": false,
"globalconfig": "C:\\Users\\xgqfrms\\AppData\\Roaming\\npm\\etc\\npmrc",
"global-style": false,
"group": 0,
"ham-it-up": false,
"heading": "npm",
"if-present": false,
"ignore-prepublish": false,
"ignore-scripts": false,
"init-module": "C:\\Users\\xgqfrms\\.npm-init.js",
"init-author-name": "",
"init-author-email": "",
"init-author-url": "",
"init-version": "1.0.0",
"init-license": "ISC",
"key": null,
"legacy-bundling": false,
"link": false,
"loglevel": "notice",
"logs-max": 10,
"long": false,
"maxsockets": 50,
"message": "%s",
"node-options": null,
"node-version": "10.15.3",
"offline": false,
"onload-script": null,
"only": null,
"optional": true,
"otp": null,
"package-lock": true,
"package-lock-only": false,
"parseable": false,
"prefer-offline": false,
"prefer-online": false,
"preid": "",
"production": false,
"progress": true,
"proxy": null,
"https-proxy": null,
"noproxy": null,
"read-only": false,
"rebuild-bundle": true,
"registry": "https://registry.npmjs.org/",
"rollback": true,
"save": true,
"save-bundle": false,
"save-dev": false,
"save-exact": false,
"save-optional": false,
"save-prefix": "^",
"save-prod": false,
"script-shell": null,
"scripts-prepend-node-path": "warn-only",
"searchopts": "",
"searchexclude": null,
"searchlimit": 20,
"searchstaleness": 900,
"send-metrics": false,
"shell": "C:\\WINDOWS\\system32\\cmd.exe",
"shrinkwrap": true,
"sign-git-commit": false,
"sign-git-tag": false,
"sso-poll-frequency": 500,
"sso-type": "oauth",
"strict-ssl": true,
"tag": "latest",
"tag-version-prefix": "v",
"timing": false,
"tmp": "C:\\Users\\xgqfrms\\AppData\\Local\\Temp",
"unicode": false,
"unsafe-perm": true,
"update-notifier": true,
"usage": false,
"user": 0,
"userconfig": "C:\\Users\\xgqfrms\\.npmrc",
"umask": 0,
"version": false,
"versions": false,
"viewer": "browser",
"globalignorefile": "C:\\Users\\xgqfrms\\AppData\\Roaming\\npm\\etc\\npmignore"
}
$ npm config set <key> <value> [-g|--global]
$ npm config get <key>
$ npm config delete <key>
$ npm config list [-l] [--json]
$ npm config edit
$ npm get <key>
$ npm set <key> <value> [-g|--global]
# aliases: c
https://docs.npmjs.com/misc/config
https://docs.npmjs.com/cli/config
https://docs.npmjs.com/files/npmrc
https://docs.npmjs.com/managing-your-profile-settings
https://stackoverflow.com/questions/42137329/npm-config-list-environment-configs-registry
npm install -d
holy shit
https://docs.npmjs.com/cli/install
https://www.npmjs.com.cn/cli/install/
这个 -d --save 啥意思,要么 -D
/ --save-dev
, 要么 -S
/ --save
所以你这个 -d --save 不存在的呀;要么 -D / --save-dev , 要么 -S / --save
-d 不认识,直接被 npm 忽略了, 所以 --save 才会生效
refs
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/10810865.html
未经授权禁止转载,违者必究!