以前工作`gulp`项目:`npm update`抛出`tar.unpack untar error`

时间:2016-02-11 17:33:15

标签: node.js npm gulp

我的项目之前已经开始工作,但是为回购做贡献的勤劳的人添加了新的依赖项,现在 array(10) { [0]=> array(4) { ["nationality"]=> string(3) "USA" ["branda"]=> int(37) ["brandb"]=> int(491) ["combined"]=> int(9) } [1]=> array(4) { ["nationality"]=> string(5) "India" ["branda"]=> int(32) ["brandb"]=> int(206) ["combined"]=> int(8) } [2]=> array(4) { ["nationality"]=> string(5) "Egypt" ["branda"]=> int(26) ["brandb"]=> int(117) ["combined"]=> int(9) } [3]=> array(4) { ["nationality"]=> string(9) "Indonesia" ["branda"]=> int(18) ["brandb"]=> int(129) ["combined"]=> int(3) } [4]=> array(4) { ["nationality"]=> string(6) "Russia" ["branda"]=> int(64) ["brandb"]=> int(418) ["combined"]=> int(6) } [5]=> array(4) { ["nationality"]=> string(5) "China" ["branda"]=> int(82) ["brandb"]=> int(710) ["combined"]=> int(21) } [6]=> array(4) { ["nationality"]=> string(6) "Turkey" ["branda"]=> int(166) ["brandb"]=> int(536) ["combined"]=> int(28) } [7]=> array(4) { ["nationality"]=> string(11) "Netherlands" ["branda"]=> int(127) ["brandb"]=> int(1498) ["combined"]=> int(23) } [8]=> array(4) { ["nationality"]=> string(6) "Israel" ["branda"]=> int(87) ["brandb"]=> int(1266) ["combined"]=> int(14) } [9]=> array(4) { ["nationality"]=> string(2) "UK" ["branda"]=> int(182) ["brandb"]=> int(2935) ["combined"]=> int(24) } } 左右抛出了npm update。我该如何解决这个问题?

我得到了很多,但这里有一个错误块:

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)

注意:SO上有许多类似的问题(123),但没有一个用于更新已经正常工作的项目,但是在初始安装时。

1 个答案:

答案 0 :(得分:0)

在github上遇到this issue。故事的简短版本就是简单地运行:

tar.unpack untar error

然后再次运行npm cache clean

注意:如果您尝试安装某些内容而不是更新以前正在运行的项目,这可能对您不起作用;相反,请参阅问题中链接的SO帖子,即123