繁体   English   中英

npm 安装返回 304 和 404 错误而不是安装包

[英]npm install returns 304 and 404 errors instead of installing packages

当我运行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 看起来不错。 有什么建议么?

您是否在代理或防火墙后面访问互联网? 许多大型军团都有防火墙来阻止这些来源。 如果不是这种情况,可能 npm 源在您所在的地区运行缓慢或受阻。 尝试在您当地搜索 npm 源。

在中国“ https://npm.taobao.org ”比官方的npm寄存器快很多。

抱歉,我没有足够的声誉来发表评论。

到了它的底部。 我删除了我的应用程序文件夹的内容并将一组新的程序文件复制到其中。 我没有注意到的是,当我删除我的终端时,我的终端遵循了我已删除文件的路径,因此基本上指向垃圾箱中的一个位置,这似乎导致了npm install的问题。

更改到正确的目录并运行npm install再次解决了该问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM