windows 7: node ignoring PATH and NODE_PATH

1,972 views
Skip to first unread message

Michael Mossey

unread,
Jun 12, 2014, 3:59:13 PM6/12/14
to nod...@googlegroups.com
I'm on Windows 7, and I've installed node and npm via the MSI on the nodejs website. I installed several modules including karma using npm, and when I installed them I used the -g option. npm put the modules in c:\User\Mike\AppData\Roaming\npm\node_modules. Now if I run a command like "node karma" I get

Error: cannot find module at <current working directory>\karma

I've set NODE_PATH to c:\User\Mike\AppData\Roaming\npm\node_modules (and also tried dropping the node_modules from the end) and I get the same error. It's like it's ignoring NODE_PATH entirely.

Any ideas?
Mike

greelgorke

unread,
Jun 13, 2014, 3:45:52 AM6/13/14
to nod...@googlegroups.com
if you install a package with -g then the respective command should be in your PATH, so you have to execute the karma command. just type "karma", not "node karma". with the latter you're calling node and providing it with a name, which is interpreted as a file in your cwd, which is of course not there.

Angel Java Lopez

unread,
Jun 14, 2014, 5:34:28 PM6/14/14
to nod...@googlegroups.com
The install should add 

 c:\User\Mike\AppData\Roaming\npm\node_modules

to your PATH

If it is not in your PATH (not NODE_PATH), add it manually

Angel "Java" Lopez
@ajlopez



--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/764501c2-dab3-47de-a7fa-e0d0596ff292%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Александр Кузнецов

unread,
May 6, 2016, 3:41:39 PM5/6/16
to nodejs
Same thing happened to me with "yo". Any solutions found so far?

Luiz Pizano Fonseca

unread,
Oct 8, 2016, 2:06:02 AM10/8/16
to nodejs
Same problem with 'body-parser'. Any solution now?
Reply all
Reply to author
Forward
0 new messages