isaacs/npm — Issue #1849: NPM Update/Install issue
Author: warriorpostman
Created: 2011-12-07 19:11:03+00:00
State: open

Hi there, I recently updated to the latest version of NPM 1.0.106, and Node (0.6.x). While trying to reconfigure how my node modules are managed, I ran into some issues.

I did the following:

1. In my project directory I called "npm init", which prompted me for answers to creating package.json
2. I called "npm update"
3. I called "npm install", at which point, I got the following err message:

info it worked if it ends with ok
2 verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
3 info using npm@1.0.106
4 info using node@v0.6.5
5 verbose /usr/local/bin/node node symlink
6 verbose config file /Users/rustamkasad/.npmrc
7 verbose config file /usr/local/etc/npmrc
8 verbose config file /usr/local/lib/node_modules/npm/npmrc
9 ERR! Couldn't read dependencies.
10 ERR! Error: ENOENT, no such file or directory '/Users/rustamkasad/package.json'
11 ERR! Report this *entire* log at:
12 ERR!
13 ERR! or email it to:
14 ERR!
15 ERR!
16 ERR! System Darwin 11.2.0
17 ERR! command "node" "/usr/local/bin/npm" "install"
18 ERR! cwd /Users/rustamkasad/localmusiq/web
19 ERR! node -v v0.6.5
20 ERR! npm -v 1.0.106
21 ERR! path /Users/rustamkasad/package.json
22 ERR! code ENOENT
23 verbose exit [ 1, true ]

(I hope it's okay to report this issue here)

Questions:

1. My current prefix is /Users//node_modules, but I am advised by colleagues that the node_modules directory should be whereever the root of your current project is. I did "npm init" in the root of my project directory, thinking this would somehow make the prefix for that project in the root, but for some reason, it still wants to look at my original npm prefix. Am I heading down the wrong path here?

2. Is there a way that I can "clean" my existing module installations? Or, do I maybe need to start from scratch? Please advise...