Unable to run npm command on NodeJs(.6)

5,298 views
Skip to first unread message

sk123

unread,
Feb 14, 2012, 6:00:00 PM2/14/12
to nodejs
OS - Windows 7

Steps
1. Downloaded the latest version of NodeJs which is supposed to have
npm by default.
2. Ran node.exe
3. Gave command as npm and I see
ReferenceError: npm is not defined
at repl:1:2
at REPLServer.eval (repl.js:80:21)
at Interface.<anonymous> (repl.js:182:12)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:162:10)
at Interface._line (readline.js:426:8)
at Interface._ttyWrite (readline.js:603:14)
at ReadStream.<anonymous> (readline.js:82:12)
at ReadStream.emit (events.js:88:20)
at ReadStream._emitKey (tty.js:327:10)
4. Tried giving an npm install command ...I just see "..." on the
console and nothing happens

I am new to both nodejs and npm. Any help will be greatly appreciated.

Thanks!

Дмитрий Лукичёв

unread,
Feb 14, 2012, 8:39:34 PM2/14/12
to nodejs
You should run 'npm.exe' instead of 'node.exe' cause 'npm' is not a
nodejs' command, but a separate package.

sk123

unread,
Feb 15, 2012, 1:28:02 PM2/15/12
to nodejs
Hi,

Thanks for the quick reply. I did try that too but I was not able to
find npm.exe. So I was not sure what to do.

Where can I find this npm.exe? Is it supposed to be installed with
NodeJs?

Thanks!

Angel Java Lopez

unread,
Feb 15, 2012, 2:24:02 PM2/15/12
to nod...@googlegroups.com
Usually, at your program files folder inside a nodejs folder.

Maybe you should add that folder to your path. Some weeks ago, I tried a Windows installer, and the path was not modified to point to that directory after installation, but I don't sure.

BTW, I had a problem with that installation: it broke my Ruby on Rails applications that use ExtJs, ExtJs tried to use a javascript engine, and it find NodeJs, but ExtJs didn't support spaces in the full path to node. 

2012/2/15 sk123 <kswe...@gmail.com>
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: 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 post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Isaac Schlueter

unread,
Feb 15, 2012, 3:57:44 PM2/15/12
to nod...@googlegroups.com
Sk123,

Install node using the windows installer msi. It will install node
and npm. http://nodejs.org/dist/v0.6.10/node-v0.6.10.msi

Run npm from the command line directly, not in the node repl.

Brandon Benvie

unread,
Feb 15, 2012, 4:17:29 PM2/15/12
to nod...@googlegroups.com
It's npm.cmd, not npm.exe. Either would run with `npm` if located in your path (not from in Node).

Something that you might find useful is this. https://raw.github.com/Benvie/npm/cmd-loop/bin/npm.cmd. Save that wherever your node.exe is, presumably C:\Programs Files (x86)\nodejs. Then you can type "npm" in `run` (press Start button in Windows, then type npm<enter>). 

sk123

unread,
Feb 15, 2012, 4:26:54 PM2/15/12
to nodejs
It worked.

I had to make sure that npm.cmd was in the same folder as the
node.exe .

Thank you so much everyone!

On Feb 15, 1:17 pm, Brandon Benvie <brandon.ben...@gmail.com> wrote:
> It's npm.cmd, not npm.exe. Either would run with `npm` if located in your
> path (not from in Node).
>
> Something that you might find useful is this.https://raw.github.com/Benvie/npm/cmd-loop/bin/npm.cmd. Save that wherever
Reply all
Reply to author
Forward
0 new messages