I have trouble with spark-cli

There's a solution for npm on Mac in general.

  1. sudo npm config set registry http://registry.npmjs.org/

  2. chown [username] .npm


Anyone interested to debug more and solve the issue can try

node.js - NPM cannot install dependencies - Attempt to unlock something which hasn't been locked - Stack Overflow

I worked with a co-worker this afternoon and figured out what the problem was. My ".npm" folder in my home directory was owned by the root user instead of myself. I'm not sure what happened to cause that. Maybe I installed node or npm as the root admin at one point. In any case I just ran "chown [username] .npm" and I was finally able to run "npm install" commands from my projects again!

share|improve this answer
answered Mar 5 at 19:55

TJ Kirchner
4341618