首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装的工件npm存储库

无法安装的工件npm存储库
EN

Stack Overflow用户
提问于 2018-01-17 05:59:35
回答 1查看 599关注 0票数 1

在我安装Artifactory V5.5.1之后,只需一次单击npm设置。我把它添加到我的npm注册中心,并使用npm安装一些东西,给了我Cannot read property 'replace' of null。我检查了~/.npm/npm/underscore/目录,它都是空的(工件和npm运行在nginx之后,并且给出了内部域)。

我尝试过npm v3和v4,同时使用了节点v6和v8

下面是运行npm i underscore的日志

代码语言:javascript
复制
0 info it worked if it ends with ok
1 verbose cli [ '/Users/Joesonw/.nvm/versions/node/v8.4.0/bin/node',
1 verbose cli   '/Users/Joesonw/.nvm/versions/node/v8.4.0/bin/npm',
1 verbose cli   'i',
1 verbose cli   'underscore' ]
2 info using npm@4.6.1
3 info using node@v8.4.0
4 silly install loadCurrentTree
5 silly install readLocalPackageData
6 silly fetchPackageMetaData underscore
7 silly fetchNamedPackageData underscore
8 silly mapToRegistry name underscore
9 silly mapToRegistry using default registry
10 silly mapToRegistry registry http://npm/
11 silly mapToRegistry data Result {
11 silly mapToRegistry   raw: 'underscore',
11 silly mapToRegistry   scope: null,
11 silly mapToRegistry   escapedName: 'underscore',
11 silly mapToRegistry   name: 'underscore',
11 silly mapToRegistry   rawSpec: '',
11 silly mapToRegistry   spec: 'latest',
11 silly mapToRegistry   type: 'tag' }
12 silly mapToRegistry uri http://npm/underscore
13 verbose request uri http://npm/underscore
14 verbose request no auth needed
15 info attempt registry request try #1 at 13:55:04
16 verbose request id 2cf11cb542a89762
17 http request GET http://npm/underscore
18 http 200 http://npm/underscore
19 verbose headers { date: 'Wed, 17 Jan 2018 05:55:04 GMT',
19 verbose headers   'content-type': 'application/json',
19 verbose headers   'transfer-encoding': 'chunked',
19 verbose headers   connection: 'keep-alive',
19 verbose headers   server: 'Artifactory/5.5.1',
19 verbose headers   'x-artifactory-id': '270f055a61f21c28:-11c3536d:16102a8c182:-8000',
19 verbose headers   etag: '546fb6762c99c7ac3b7648e8dfe320681065d0ba' }
20 silly get cb [ 200,
20 silly get   { date: 'Wed, 17 Jan 2018 05:55:04 GMT',
20 silly get     'content-type': 'application/json',
20 silly get     'transfer-encoding': 'chunked',
20 silly get     connection: 'keep-alive',
20 silly get     server: 'Artifactory/5.5.1',
20 silly get     'x-artifactory-id': '270f055a61f21c28:-11c3536d:16102a8c182:-8000',
20 silly get     etag: '546fb6762c99c7ac3b7648e8dfe320681065d0ba' } ]
21 verbose get saving underscore to /Users/Joesonw/.npm/npm/underscore/.cache.json
22 verbose correctMkdir /Users/Joesonw/.npm correctMkdir not in flight; initializing
23 verbose makeDirectory /Users/Joesonw/.npm creation not in flight; initializing
24 silly makeDirectory /Users/Joesonw/.npm uid: 501 gid: 20
25 silly install normalizeTree
26 silly install loadIdealTree
27 silly install cloneCurrentTreeToIdealTree
28 silly install loadShrinkwrap
29 silly install loadAllDepsIntoIdealTree
30 silly resolveWithNewModule underscore@1.8.3 checking installable status
31 silly currentTree npmtest@1.0.0
32 silly idealTree npmtest@1.0.0
32 silly idealTree └── underscore@1.8.3
33 silly install generateActionsToTake
34 silly diffTrees action count 1
35 silly diffTrees add underscore@1.8.3
36 silly decomposeActions action count 8
37 silly decomposeActions fetch underscore@1.8.3
38 silly decomposeActions extract underscore@1.8.3
39 silly decomposeActions test underscore@1.8.3
40 silly decomposeActions preinstall underscore@1.8.3
41 silly decomposeActions build underscore@1.8.3
42 silly decomposeActions install underscore@1.8.3
43 silly decomposeActions postinstall underscore@1.8.3
44 silly decomposeActions finalize underscore@1.8.3
45 silly install executeActions
46 silly doSerial global-install 0
47 silly doParallel fetch 1
48 verbose correctMkdir /Users/Joesonw/.npm/_locks correctMkdir not in flight; initializing
49 verbose makeDirectory /Users/Joesonw/.npm/_locks creation not in flight; initializing
50 silly makeDirectory /Users/Joesonw/.npm/_locks uid: 501 gid: 20
51 verbose lock using /Users/Joesonw/.npm/_locks/staging-35a192c1000dd88d.lock for /Users/Joesonw/test/npmtest/node_modules/.staging
52 silly doParallel extract 1
53 silly extract underscore@1.8.3
54 silly addNamed underscore@1.8.3
55 verbose addNamed "1.8.3" is a plain semver version for underscore
56 silly mapToRegistry name underscore
57 silly mapToRegistry using default registry
58 silly mapToRegistry registry http://npm/
59 silly mapToRegistry data Result {
59 silly mapToRegistry   raw: 'underscore',
59 silly mapToRegistry   scope: null,
59 silly mapToRegistry   escapedName: 'underscore',
59 silly mapToRegistry   name: 'underscore',
59 silly mapToRegistry   rawSpec: '',
59 silly mapToRegistry   spec: 'latest',
59 silly mapToRegistry   type: 'tag' }
60 silly mapToRegistry uri http://npm/underscore
61 verbose addNameVersion registry:http://npm/underscore not in flight; fetching
62 verbose get http://npm/underscore not expired, no request
63 silly mapToRegistry name underscore
64 silly mapToRegistry using default registry
65 silly mapToRegistry registry http://npm/
66 silly mapToRegistry data Result {
66 silly mapToRegistry   raw: 'underscore',
66 silly mapToRegistry   scope: null,
66 silly mapToRegistry   escapedName: 'underscore',
66 silly mapToRegistry   name: 'underscore',
66 silly mapToRegistry   rawSpec: '',
66 silly mapToRegistry   spec: 'latest',
66 silly mapToRegistry   type: 'tag' }
67 silly mapToRegistry uri http://npm/underscore
68 verbose addRemoteTarball ://npm:80/api/npm/npm/underscore/download/underscore-1.8.3.tgz not in flight; adding
69 verbose stack TypeError: Cannot read property 'replace' of null
69 verbose stack     at cf (/Users/Joesonw/.nvm/versions/node/v8.4.0/lib/node_modules/npm/node_modules/npm-cache-filename/index.js:11:17)
69 verbose stack     at addRemoteTarball (/Users/Joesonw/.nvm/versions/node/v8.4.0/lib/node_modules/npm/lib/cache/add-remote-tarball.js:37:13)
69 verbose stack     at /Users/Joesonw/.nvm/versions/node/v8.4.0/lib/node_modules/npm/lib/cache/add-named.js:217:9
69 verbose stack     at mapToRegistry (/Users/Joesonw/.nvm/versions/node/v8.4.0/lib/node_modules/npm/lib/utils/map-to-registry.js:62:3)
69 verbose stack     at fetchit (/Users/Joesonw/.nvm/versions/node/v8.4.0/lib/node_modules/npm/lib/cache/add-named.js:191:7)
69 verbose stack     at /Users/Joesonw/.nvm/versions/node/v8.4.0/lib/node_modules/npm/lib/cache/add-named.js:187:21
69 verbose stack     at /Users/Joesonw/.nvm/versions/node/v8.4.0/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:284:29
69 verbose stack     at FSReqWrap.oncomplete (fs.js:152:21)
70 verbose cwd /Users/Joesonw/test/npmtest
71 verbose Darwin 16.7.0
72 verbose argv "/Users/Joesonw/.nvm/versions/node/v8.4.0/bin/node" "/Users/Joesonw/.nvm/versions/node/v8.4.0/bin/npm" "i" "underscore"
73 verbose node v8.4.0
74 verbose npm  v4.6.1
75 error Cannot read property 'replace' of null
76 verbose exit [ 1, true ]
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-01-20 12:38:07

我在nginx的后面运行了artifactory,并使用artifactory 文档给出的糖果。

事实证明,“X-艺术-覆盖-基本-Url”将陷入npm的困境。

它会让npm返回像://一样的url中的包zip文件链接,而不是http://

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48294485

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档