Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nodejs seems to be not working; npm do work, however

I was running Node.js and Node-RED (depends on Node.js) normally one week ago. My system is Windows 8.1 64 bits.

Nevertheless, today I am having a issue:

As normally, I go to the node-red folder, and run node red.js. Then, surprisingly I got the following message from the prompt:


Node Commands

Syntax:
    node {operator} [options] [arguments]

Parameters:
        /? or /help   - Display this help message.
        list          - List nodes or node history or the cluster
        listcores     - List cores on the cluster
        view          - View properties of a node
        online        - Set nodes or node to online state
        offline       - Set nodes or node to offline state
        pause         - Pause node [deprecated]
        resume        - Resume node [deprecated]

For more information about HPC command-line tools,
see http://go.microsoft.com/fwlink/?LinkId=120724.

So, after evaluating many things, such as, environment variables, npm and node folders, etc it seems to be ok. BUT, when I run npm -v, the console shows the npm version installed. And when I run node -v, I get the same message as above... I remember when I first installed Node.js I could see the node.js version installed.

In these days, I performed a dual boot with Linux Ubuntu 14.04 and I think this is may the problem (I performed I CCLEANER analysis that remove some Windows registers).

Currently, my personal/user path variables related to them are: C:\Program Files\nodejs

System environment variables are: C:\Program Files\nodejs

PS:

  • The Node.js console (node.exe) opens normally.
  • I tried to run the prompt as administrator and with my user.
  • I need to run the 0.10x version of node.js. And this issue is related with this version (0.10x).

Thanks.

like image 513
pascoal Avatar asked Dec 24 '22 20:12

pascoal


2 Answers

Most likely you have the Microsoft HPC Pack installed, which has its own node.exe and it's this executable that is being picked.

If you're not using that, I'd suggest removing it to make things less confusing. Otherwise if you're sure you have installed node.js from the node.js website (e.g. the Windows installer), then make sure that the node.js path in your %PATH% comes before the path for Microsoft HPC Pack's node.exe to make sure it picks up the "right" node.exe.

like image 83
mscdex Avatar answered Dec 27 '22 22:12

mscdex


Microsoft HPC Pack bin(C:\Program Files\Microsoft HPC Pack 2008 R2\Bin) folder has node.exe executable file and it is set in path before nodejs path. I removed it and it is working as expected.

like image 23
Sandeep M Avatar answered Dec 27 '22 21:12

Sandeep M