# I have trouble with spark-cli

**URL:** <https://community.particle.io/t/i-have-trouble-with-spark-cli/3447>\
**Category:** Getting Started\
**Created:** [March 15, 2014, 8:59pm UTC](https://community.particle.io/t/i-have-trouble-with-spark-cli/3447 "2014-03-15T20:59:38Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 16, 2014, 12:38am UTC](https://community.particle.io/t/i-have-trouble-with-spark-cli/3447/8 "2014-03-16T00:38:14Z")

</div>

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

1. sudo npm config set registry [http://registry.npmjs.org/](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](http://stackoverflow.com/a/22207869)

> 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

---

_[View the full topic](https://community.particle.io/t/i-have-trouble-with-spark-cli/3447)._
