apm upgrade: Failed to change folder ownership under npm cache

If you meet errors similar to the following one while upgrading apm packages via command line:

npm ERR! Failed to change folder ownership under npm cache for %s /Users/Chris/.atom/.node-gyp/.atom/.apm/_git-remotes/https-github-com-Glavin001-Coffee-Formatter-git-41cd2663
npm ERR! Error: ENOENT, readdir '/Users/Chris/.atom/.node-gyp/.atom/.apm/_git-remotes/https-github-com-Glavin001-Coffee-Formatter-git-41cd2663/description'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

Its mostly just because of there are not just one versions of node-gyp under ~/.atom/.node-gyp.

In my case, there were 3 versions:

ls ~/.atom/.node-gyp/.node-gyp
0.11.10 0.11.13 0.17.0

The way to fix this issue is very simple, just run the following command to force Atom to recreate .node-gyp folder:

rm -dr ~/.atom/.node-gyp

Now, apm upgrade works again.

 
16
Kudos
 
16
Kudos

Now read this

Node.js, Travis CI and Coveralls

在 GitHub 或 npm 社区混多了,你肯定见过这些图示: 这些图示是 shield.io 提供的服务,当然,像 npm、build、coverage 这些是别的服务提供的: npm - david-dm.org build - travis-ci.org coverage - coveralls.io 其中 build 的作用是在你有 push 或 pull request 的时候,会执行设置好的 build 脚本,并记录 build 的详细日志: 通过... Continue →