0

I try to install CastMyCode on my machine using this command: npm install -g castmycode

Unfortunately, I got this error message:

npm WARN locking Error: EACCES, open '/Users/zulhilmizainudin/.npm/_locks/castmycode-603889af8ee0127d.lock'
npm WARN locking     at Error (native)
npm WARN locking  /Users/zulhilmizainudin/.npm/_locks/castmycode-603889af8ee0127d.lock failed { [Error: EACCES, open '/Users/zulhilmizainudin/.npm/_locks/castmycode-603889af8ee0127d.lock']
npm WARN locking   errno: -13,
npm WARN locking   code: 'EACCES',
npm WARN locking   path: '/Users/zulhilmizainudin/.npm/_locks/castmycode-603889af8ee0127d.lock' }
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "castmycode"
npm ERR! node v0.12.0
npm ERR! npm  v2.6.1

npm ERR! Attempt to unlock /usr/local/lib/node_modules/castmycode, which hasn't been locked
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/zulhilmizainudin/npm-debug.log

I'm using NPM v2.6.1.

Btw, for those of you that don't know what CastMyCode is, it's actually a simple web app that allow anybody to share their codes and let others view their codes.

It's built by one of my friend. If you're programming mentor/lecturer, CastMyCode can help your students see all your codes changes right inside their web browsers.

Zulhilmi Zainudin
  • 9,017
  • 12
  • 62
  • 98
  • Sounds like a permissions problem, see this question: [here][1] [1]: http://stackoverflow.com/questions/22152162/npm-cannot-install-dependencies-attempt-to-unlock-something-which-hasnt-been – IBam Apr 08 '15 at 20:05

1 Answers1

0

Solved. I run this 2 commands inside my terminal:

sudo chown -R $USER ~/.npm
sudo chown -R $USER /usr/local/lib/node_modules

Then I run this command:

npm install -g castmycode

CastMyCode now successfully installed & I can use it. Thanks IBam for sharing the solution!

Zulhilmi Zainudin
  • 9,017
  • 12
  • 62
  • 98