我有一个 Node.js 项目正在与同事合作。我最近换了电脑,并用 git clone 了这个特定的代码。
我在应用程序的根级别有一个 package.json,每次我尝试运行 npm install 时都会收到以下错误
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'i',
1 verbose cli '-verbose',
1 verbose cli 'concurrently' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 8798ce35794761e2
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 502 https://example.com/artifactory/api/npm/npm-all/concurrently 70322ms attempt #3
8 silly fetchPackageMetaData error for concurrently@^4.1.0 502 Bad Gateway - GET https://example.com/artifactory/api/npm/npm-all/concurrently
9 timing stage:rollbackFailedOptional Completed in 1ms
10 timing stage:runTopLevelLifecycles Completed in 70378ms
11 verbose stack Error: 502 Bad Gateway - GET https://example.com/artifactory/api/npm/npm-all/concurrently
11 verbose stack at res.buffer.catch.then.body (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:104:15)
11 verbose stack at processTicksAndRejections (internal/process/task_queues.js:86:5)
12 verbose statusCode 502
13 verbose pkgid concurrently@^4.1.0
14 verbose cwd C:\UserData\example\Documents\DEVS\example
15 verbose Windows_NT 10.0.17134
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-verbose" "concurrently"
17 verbose node v11.13.0
18 verbose npm v6.7.0
19 error code E502
20 error 502 Bad Gateway - GET https://example.com/artifactory/api/npm/npm-all/concurrently
21 verbose exit [ 1, true ]
我当前的 npm 配置如下:
; cli configs
metrics-registry = "https://example.com/artifactory/api/npm/npm-all"
scope = ""
user-agent = "npm/6.7.0 node/v11.13.0 win32 x64"
; userconfig C:\Users\example\.npmrc
http_proxy = "http://proxy:port"
https-proxy = "http://proxy:port/"
https_proxy = "http://proxy:port"
phantomjs_cdnurl = "https://example.com/artifactory/simple/libs-external/npmBinaries/phantomjs/"
proxy = "http://proxy:port/"
registry = "https://example.com/artifactory/api/npm/npm-all"
shrinkwrap = false
strict-ssl = false
; builtin config undefined
prefix = "C:\\Users\\example\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\UserData\example\Documents\DEVS\example
; HOME = C:\Users\example
; "npm config ls -l" to show all defaults.
我已经重新安装了 node 和 npm,但无济于事。我也在使用 Fiddler,但仍然不起作用。我还运行了 npm cache clean,但仍然不起作用。
有人能解释一下吗?我搜索过一个可行的解决方案,但都不起作用。