프록시에 Nexus 3.0.1-01을 사용 중입니다. https://registry.npmjs.org/ 프록시를 포함하는 그룹을 npmjs.org와 로컬로 호스팅되는 npm repo에 구성했습니다. 로컬 npm-config에서 nexus를 Nexus에 레지스트리로 지정했습니다. 인터넷에 연결된 모든 연결은 회사의 http 프록시를 통과합니다.Nexus 3 대부분의 경우 프록시가 실패합니다.
Nexus와 함께 bower (예 : npm install -g bower
통해)와 같은 '공개'종속성을 해결하면 10 회 중 8 회 실패합니다. 공식 레지스트리를 가리킬 때 모든 것이 100 % 잘 동작합니다.
오류는 다음과 같습니다
$ npm install -g bower
npm ERR! Linux 3.13.0-107-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! node v4.3.2
npm ERR! npm v2.14.12
npm ERR! Cannot convert undefined or null to object
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! npm-debug.log
디버그 로그를 살펴보면, 우리는 HTTP 404 다음 HTTP (304)을 얻을하고 실패 설치합니다.
2 info using [email protected]
3 info using [email protected]
[...]
21 http request GET http://nexus/repository/npm/bower
22 http 404 http://nexus/repository/npm/bower
23 verbose headers { date: 'Thu, 02 Feb 2017 08:32:35 GMT',
23 verbose headers server: 'Nexus/3.0.1-01 (OSS)',
23 verbose headers 'x-frame-options': 'SAMEORIGIN',
23 verbose headers 'x-content-type-options': 'nosniff',
23 verbose headers 'content-type': 'application/json',
23 verbose headers 'content-length': '37',
23 verbose headers 'x-cache': 'MISS from proxy',
23 verbose headers 'x-cache-lookup': 'HIT from proxy:3128',
23 verbose headers connection: 'keep-alive' }
24 silly get cb [ 304, undefined ]
25 verbose get saving undefined to /user/.npm/nexus/repository/npm/bower/.cache.json
26 silly addNameTag next cb for bower with tag latest
27 verbose stack TypeError: Cannot convert undefined or null to object
27 verbose stack at Function.keys (native)
27 verbose stack at installTargetsError (/usr/lib/node_modules/npm/lib/cache/add-named.js:273:24)
27 verbose stack at next (/usr/lib/node_modules/npm/lib/cache/add-named.js:94:10)
27 verbose stack at RES (/usr/lib/node_modules/npm/node_modules/inflight/inflight.js:23:14)
27 verbose stack at f (/usr/lib/node_modules/npm/node_modules/once/once.js:17:25)
27 verbose stack at fixName (/usr/lib/node_modules/npm/lib/cache/add-named.js:29:5)
27 verbose stack at saved (/usr/lib/node_modules/npm/lib/cache/caching-client.js:173:7)
27 verbose stack at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:210:7
27 verbose stack at FSReqWrap.oncomplete (fs.js:82:15)
내가 말했듯이, 우리는 몇 번 설치를 반복 할 수 있고 결국 작동 할 것입니다. 우리가 https://registry.npmjs.org/ 물마루 우리의 프록시를 사용하면 모든 것이 잘 작동합니다.
또한 Nex 레지스트리 (프록시)로 사용하면 Nexus 2.11.3-01도 정상적으로 작동합니다.
Sonatype JIRA를 검색했지만 이것이 Nexus 3 문제인지 여부에 대한 힌트를 찾을 수 없습니다.
힌트를 보내 주시면 감사하겠습니다.
어떤 버전의 npm/node 및 os를 사용하고 있습니까? 문제를 재현하는 데 도움이됩니다. – DarthHater
최신 버전 (3.2.0)으로 업그레이드 할 수 있습니까?이 문제가 있는지 확인하십시오. – joedragons
나는 좀 더 조사를했다. 하나의 문제는 npm이 매번 레지스트리에 액세스하지 않는다는 것입니다. 또 하나는 npm이 확실히 "발견되지 않은"결과를 캐시에 저장하는 것입니다. 해결할 때마다 캐시를 무효화 한 후에도 문제가 여전히 남아 있습니다. 해결 작업은 두 번 실패한 다음 실패 (404) 한 다음 두 번 작동하고 실패합니다. 우리는 npm 1.3.10을 사용합니다. 이 버전은 NO_PROXY 변수를 인식하지, 그래서 해결은 다음과 같은 : NPM => 프록시 => 넥서스 => 프록시 => npmjs.org 내가 여기 범인으로 프록시를 의심 ... – Bebef