运行npm install
时,我会看到很多这样的东西:
npm http fetch GET 304 http://registry.npmjs.org/is-arrayish 60ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/spdx-license-ids 67ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/spdx-exceptions 72ms (from cache)
npm http fetch GET 200 http://registry.npmjs.org/arr-union 11ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/is-buffer 68ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/is-data-descriptor 85ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/is-accessor-descriptor 90ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/is-accessor-descriptor 72ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/is-data-descriptor 66ms (from cache)
npm http fetch GET 200 http://registry.npmjs.org/has-value 6ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/p-try 92ms (from cache)
npm http fetch GET 200 http://registry.npmjs.org/set-value 12ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/posix-character-classes 68ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/static-extend 88ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/for-in 89ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/get-value 72ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/collection-visit 88ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/to-object-path 64ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/union-value 85ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/os-homedir 81ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/unset-value 87ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/delegates 76ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/aproba 82ms (from cache)
npm http fetch GET 200 http://registry.npmjs.org/map-visit 8ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/has-unicode 76ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/wide-align 73ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/capture-stack-trace 69ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/prepend-http 83ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/has-values 81ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/object-copy 61ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/object-visit 53ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/code-point-at 52ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/pseudomap 84ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/has-values 53ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/copy-descriptor 42ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/number-is-nan 76ms (from cache)
npm http fetch GET 404 http://registry.npmjs.org/@apollographql%2fapollo-tools 726ms
npm timing stage:rollbackFailedOptional Completed in 0ms
npm timing stage:runTopLevelLifecycles Completed in 6589ms
npm ERR! code E404
npm ERR! 404 Not Found: @apollographql/apollo-tools@^0.4.0
npm timing npm Completed in 6995ms
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/paulcarron/.npm/_logs/2019-10-01T19_18_38_895Z-debug.log
我不确定为什么我的软件包无法安装。我有一段模糊的回忆,我有一段时间更新了npm url,但是这里的URL看起来还可以。有什么建议吗?
答案 0 :(得分:0)
您是否正在代理或防火墙后面访问Internet?许多大型企业都有阻止这些来源的防火墙。如果不是这种情况,则可能是您所在地区的npm来源很慢或被阻止。尝试在本地搜索Google NPM源。
在中国,“ https://npm.taobao.org”比官方npm注册要快得多。
抱歉,我没有足够的声誉来发表评论。
答案 1 :(得分:0)
转到其底部。我已经删除了应用程序文件夹的内容,并将一组新的程序文件复制到其中。我没有注意到的是,当我执行删除操作时,终端遵循删除文件的路径,因此实际上是指向垃圾桶中的某个位置,该位置似乎引起了npm install
的问题。
更改到正确的目录并运行npm install
再次解决了该问题。