Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'node' is not recognized as an internal or external command #18

Closed
Ciantic opened this issue Dec 4, 2012 · 20 comments
Closed

'node' is not recognized as an internal or external command #18

Ciantic opened this issue Dec 4, 2012 · 20 comments

Comments

@Ciantic
Copy link

Ciantic commented Dec 4, 2012

I get error:

C:\Users\...>nodist update
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/1.1.68
npm http 304 https://registry.npmjs.org/npm/1.1.68
C:\...\node\bin\npm -> C:\...\node\bin\node_modules\npm\bin\npm-cli.js
npm@1.1.68 C:\...\node\bin\node_modules\npm
The system cannot find the path specified.
'node' is not recognized as an internal or external command,
operable program or batch file.

Your installation instructions are missing a one important ingredient: Add ...path...\nodist\ to your path also, the bin is not enough since node.exe is in the root directory.


Now I tried to install it also by adding only bin/ to path, then going to root directory and running. It works, but node.exe is not added to the path. And also I couldn't get the nodist stable ... commands to work.

@marcelklehr
Copy link
Member

Ok, where to start...

First up as you might have read in the readme: the node executable located in path/to/nodist is not intended to be used by the user, but by nodist only (since nodist is written in js).

@Ciantic
Copy link
Author

Ciantic commented Dec 4, 2012

You could start by writing install instructions that work? I've tried and tried with many other ways and it's not working.

@marcelklehr
Copy link
Member

The above may be the cause of some of the other issues you filed. I confirm that installation doesn't work as expected, though

@marcelklehr
Copy link
Member

npm's update broke things apparently...

@Ciantic
Copy link
Author

Ciantic commented Dec 4, 2012

okay, post here if you get it fixed. I closed the other issues.

@Ciantic
Copy link
Author

Ciantic commented Dec 4, 2012

Btw I was looking at npm.cmd and nodist.cmd, you are calling node.exe with relative paths:

"..\node.exe", I was wondering if it would be more fail-safe to actually modify the PATH environment variable so that "..\node.exe" is not called with relative path, but by overwriting PATH variable and then using it like global command.

Just an idea.

@marcelklehr
Copy link
Member

Found a fix -- bit more complex than i thought, but it works and is safe.

@marcelklehr
Copy link
Member

thanks for reporting ;)

@Ciantic
Copy link
Author

Ciantic commented Dec 4, 2012

btw, now you put the node.exe to bin directory, and it now becomes part of path by install instructions? Is this intended?

What I suggested was to add a ../node.exe to the PATH during runtime of npm.cmd and nodist.cmd, you wouldn't have to make two copies of node.exe then, right?

@marcelklehr
Copy link
Member

Yea, but the path would stay that way, even if nodist.cmd has exited... dangerous, isn't it? Apart from that, I always accept pull requests, so feel free to issue one ;)

@Ciantic
Copy link
Author

Ciantic commented Dec 4, 2012

But now I have node.exe in path always even before I've installed any with "nodist stable" (since nodist/bin/ is in the PATH), is that intended?

@marcelklehr
Copy link
Member

Yes.

@Ciantic
Copy link
Author

Ciantic commented Dec 4, 2012

Okay. Btw, by modifying PATH only during runtime I mean: returning it to normal state after the npm command has ran.

I though still don't get it why there are now two node.exes.

@marcelklehr
Copy link
Member

You don'T get why there are two exes in the repo or why there always have to be two exes in nodist/?

@Ciantic
Copy link
Author

Ciantic commented Dec 4, 2012

Here is the curx of the problem having node.exe in bin/:

C:\Program Copies\nodist>nodist 0.8.1
0.8.1

C:\Program Copies\nodist>node --version
v0.8.9

shouldn't it change the version?

@marcelklehr
Copy link
Member

Right. That's the only occasion where nodist doesn't/cannot change the node version: You won't see it change, if you're inside nodist's own directory. That's the way it is. I assume, though, that you are usually not in there...

@marcelklehr
Copy link
Member

cd .. -- and everything's fine ;)

@Ciantic
Copy link
Author

Ciantic commented Dec 4, 2012

Oh snap! Now I get it, the "nodist 0.8.1" copies the v/0.8.1/node.exe to the bin/node.exe.

Okay, thanks!

@Ciantic
Copy link
Author

Ciantic commented Dec 4, 2012

still, if the problem is:

npm uses node.exe, then it may end up using wrong version?

Since it now starts with ..\node.exe which is latest, and if it calls during install bin\node.exe which is different. That also intended?

@marcelklehr
Copy link
Member

Not really, but the latest is 0.8.15 and nodist/bin/node.exe uses
0.8.9, so i don't think that really matters...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants