[英]Previously working `gulp` project: `npm update` throws `tar.unpack untar error`
My project was previously working, but industrious people contributing to the repo added new dependencies, and now npm update
throws tar.unpack untar error
s left and right. 我的项目以前一直在工作,但是为回购做贡献的勤劳的人们增加了新的依赖关系,现在
npm update
抛出tar.unpack untar error
。 How do I fix this? 我该如何解决?
I get many of these, but here is one such error block: 我得到了很多,但是这里有一个这样的错误块:
npm ERR! tar.unpack untar error /Users/foo/bar/.npm/lodash/3.10.1/package.tgz npm http GET https://registry.npmjs.org/find-index npm ERR! Error: ENOENT, utime '/Users/foo/bar/node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/lodash/number.js' npm ERR! If you need help, you may report this *entire* log, npm ERR! including the npm and node versions, at: npm ERR! npm ERR! System Darwin 15.0.0 npm ERR! command "node" "/usr/local/bin/npm" "update" npm ERR! cwd /Users/foo/bar/ npm ERR! node -v v0.10.26 npm ERR! npm -v 1.4.3 npm ERR! path /Users/foo/bar/node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/lodash/number.js npm ERR! fstream_path /Users/foo/bar/node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/lodash/number.js npm ERR! fstream_type File npm ERR! fstream_class FileWriter npm ERR! fstream_finish_call utimes npm ERR! code ENOENT npm ERR! errno 34 npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19 npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
NOTE: There were many similar issues ( 1 , 2 , 3 ) on SO but none were for updating a project that was already working, but on initial install. 注:有许多类似的问题( 1 , 2 , 3 )对SO,但没有一个是用于更新已经开工的项目,但在初始安装。
Came across this issue on github. 在github上遇到了这个问题 。 The short version of the story is to simply run:
这个故事的简短版本是简单地运行:
npm cache clean
and then run npm update
again. 然后再次运行
npm update
。
NOTE: If you are trying to install something instead of updating a previously working project, this may not work for you; 注意:如果您尝试安装某些软件而不是更新以前可以正常运行的项目,则此方法可能对您不起作用。 instead, see the SO posts linked to in the question, ie 1 , 2 , 3 .
代替,参见SO帖链接到的问题,即1 , 2 , 3 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.