nrm & npm config All In One

nrm & npm config All In One

npm config

$ npm config --help
Manage the npm configuration files

Usage:
npm config set <key>=<value> [<key>=<value> ...]
npm config get [<key> [<key> ...]]
npm config delete <key> [<key> ...]
npm config list [--json]
npm config edit

Options:
[--json] [-g|--global] [--editor <editor>] [-L|--location <global|user|project>]
[-l|--long]

alias: c

Run "npm help config" for more info


$ npm help config

$ npm config list
$ npm config list -l
$ npm config list -l --json

$ npm config edit

$ npm config list -l | pbcopy

npm config list -l

; "default" config from default values

_auth = (protected) 
access = null 
all = false 
allow-same-version = false 
also = null 
audit = true 
audit-level = null 
auth-type = "legacy" 
before = null 
bin-links = true 
browser = null 
ca = null 
cache = "/Users/xgqfrms-mm/.npm" 
cache-max = null 
cache-min = 0 
cafile = null 
call = "" 
cert = null 
ci-name = null 
cidr = null 
color = true 
commit-hooks = true 
depth = null 
description = true 
dev = false 
diff = [] 
diff-dst-prefix = "b/" 
diff-ignore-all-space = false 
diff-name-only = false 
diff-no-prefix = false 
diff-src-prefix = "a/" 
diff-text = false 
diff-unified = 3 
dry-run = false 
editor = "vi" 
engine-strict = false 
fetch-retries = 2 
fetch-retry-factor = 10 
fetch-retry-maxtimeout = 60000 
fetch-retry-mintimeout = 10000 
fetch-timeout = 300000 
force = false 
foreground-scripts = false 
format-package-lock = true 
fund = true 
git = "git" 
git-tag-version = true 
global = false 
global-style = false 
globalconfig = "/Users/xgqfrms-mm/.nvm/versions/node/v18.12.0/etc/npmrc" 
heading = "npm" 
https-proxy = null 
if-present = false 
ignore-scripts = false 
include = [] 
include-staged = false 
include-workspace-root = false 
init-author-email = "" 
init-author-name = "" 
init-author-url = "" 
init-license = "ISC" 
init-module = "/Users/xgqfrms-mm/.npm-init.js" 
init-version = "1.0.0" 
init.author.email = "" 
init.author.name = "" 
init.author.url = "" 
init.license = "ISC" 
init.module = "/Users/xgqfrms-mm/.npm-init.js" 
init.version = "1.0.0" 
install-links = false 
json = false 
key = null 
legacy-bundling = false 
legacy-peer-deps = false 
link = false 
local-address = null 
location = "user" 
lockfile-version = null 
loglevel = "notice" 
logs-dir = null 
logs-max = 10 
; long = false ; overridden by cli
maxsockets = 15 
message = "%s" 
metrics-registry = "https://registry.npmjs.org/" 
node-options = null 
node-version = "v18.12.0" 
noproxy = [""] 
npm-version = "8.19.2" 
offline = false 
omit = [] 
omit-lockfile-registry-resolved = false 
only = null 
optional = null 
otp = null 
pack-destination = "." 
package = [] 
package-lock = true 
package-lock-only = false 
parseable = false 
prefer-offline = false 
prefer-online = false 
prefix = "/Users/xgqfrms-mm/.nvm/versions/node/v18.12.0" 
preid = "" 
production = null 
progress = true 
proxy = null 
read-only = false 
rebuild-bundle = true 
registry = "https://registry.npmjs.org/" 
replace-registry-host = "npmjs" 
save = true 
save-bundle = false 
save-dev = false 
save-exact = false 
save-optional = false 
save-peer = false 
save-prefix = "^" 
save-prod = false 
scope = "" 
script-shell = null 
searchexclude = "" 
searchlimit = 20 
searchopts = "" 
searchstaleness = 900 
shell = "/bin/zsh" 
shrinkwrap = true 
sign-git-commit = false 
sign-git-tag = false 
sso-poll-frequency = 500 
sso-type = "oauth" 
strict-peer-deps = false 
strict-ssl = true 
tag = "latest" 
tag-version-prefix = "v" 
timing = false 
tmp = "/var/folders/by/24_sdryj5sv4qvxcyjfnn64c0000gn/T" 
umask = 0 
unicode = true 
update-notifier = true 
usage = false 
user-agent = "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}" 
userconfig = "/Users/xgqfrms-mm/.npmrc" 
version = false 
versions = false 
viewer = "man" 
which = null 
workspace = [] 
workspaces = null 
workspaces-update = true 
yes = null 

; "cli" config from command line options

long = true

npm registry

https://docs.npmjs.com/cli/v7/using-npm/registry

https://docs.npmjs.com/cli/v7/commands/npm-config

https://docs.npmjs.com/cli/v7/configuring-npm/npmrc

https://docs.npmjs.com/cli/v7/using-npm/config

$ npm c edit

npm .nmprc

$ ls -al | grep 'rc'

proxy

npm config set proxy null
npm config set https-proxy null
npm config set registry http://registry.npmjs.org/

https://topitanswers.com/post/npm-err-fetcherror-request-to-http-registry-npmjs-org-webpack-dev-server-failed-reason-connect-econnrefused-127-0-0-1-8000

.nmprc

proxy=http://yourorganizationproxy.com:8080
https-proxy=http://yourorganizationproxy.com:8080

$ npm config set registry http://registry.npmjs.org/
$ npm config set strict-ssl false


$ npm config set proxy http://user:password@proxy.example.com:8181
$ npm config set https-proxy http://user:password@proxy.example.com:8181

https://stackabuse.com/npm-error-failed-to-fetch-from-registry-when-installing-module/

???

https://github.com/npm/npm/issues/19098

https://github.com/facebook/create-react-app/issues/8901

https://github.com/facebook/create-react-app/issues/11453

https://github.com/npm/npm/issues/7945

# HTTPS bug
$ npm config set registry http://registry.npmjs.org/

refs



©xgqfrms 2012-2020

www.cnblogs.com/anonymous007 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️anonymous007, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2022-11-16 02:25  anonymous007  阅读(28)  评论(2编辑  收藏  举报