0
votes

My project was previously working, but industrious people contributing to the repo added new dependencies, and now npm update throws tar.unpack untar errors left and right. 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

1 Answers

0
votes

Came across this issue on github. The short version of the story is to simply run:

npm cache clean

and then run npm update again.

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, i.e. 1, 2, 3.