1

I'm trying to install some npm modules and all goes fine until I try to install the dependencies of the installed modules. npm shows this log:

$ sudo npm install -g npm ERR! addLocal Could not install . npm ERR! Error: ENOENT, open 'package.json' 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> npm ERR! System Darwin 13.2.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" npm ERR! cwd /Users/roemerbakker npm ERR! node -v v0.10.26 npm ERR! npm -v 1.4.21 npm ERR! path package.json npm ERR! code ENOENT npm ERR! errno 34 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/roemerbakker/npm-debug.log npm ERR! not ok code 0 $ 

Also tried the command without -g but it doesn't work either.

3
  • Does package.json exist in the folder you are running the command? If it does, can you open it in text editor and see the file is valid? Commented Jul 25, 2014 at 8:28
  • @alandarev just created one in ~/ but is that necessary if I just want to install the dependencies for global modules? And what does it have to say? Commented Jul 25, 2014 at 8:53
  • As @Charminbear said, you do not need to run npm install for installed packages. Commented Jul 25, 2014 at 10:37

2 Answers 2

1

There is no need for this. When you install a npm package with npm install <package name> (globally or locally), it already installs all of its dependencies on its own.

You only need the npm install command when you checked out an Application with a package.json-File to install the APPLICATIONS Dependencies.

Sign up to request clarification or add additional context in comments.

Comments

0

If you want to upgrade ALL global packages, you should use: npm update -g

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.