Node isn't recognized - node.js

Referring to the above picture, can someone please tell my why my NPM script would continually fail saying that node is not recognized.
nodejs is clearly in my $PATH and it correctly identifies where it is on my computer outside of an npm script.
I am using Git Bash inside ConEMU on Windows Version 10.0.17134 Build 17134.
I wouldn't be surprised if the issue is with Windows, as the problem seems to have popped up since the latest OS update, installed just over a week ago (I've been having this issue for around that same amount of time)

I have finally got it working! It is, unsurprisingly, a Windows issue.. Because I had a few entries in my $PATH, and the nodejs one was at the end, Windows would silently fail when reading the entire path, and not get as far as the nodejs entry. The fix was to move the nodejs in the Environment Variables control panel to the very top

Related

''node' is not recognized as an internal or external command,' in vscode

I'm working on setting up the Suitecloud Development Framework in the NetSuite instance for my company. I've installed Node v16.13.0, npm 8.1.0, and suitecloud 1.3.1.
Running node -v, npm -v, etc. all works from cmd but will throw a not recognized error when I use the terminal in VSCode.
I can get my VSCode to identify node with
SET PATH=C:\Program Files\Nodejs;%PATH%
but this only fixes it for the session and still doesn't give me access to run anything from suitecloud.
I've checked my Environment Variables as per every other help section I've found for this issue but I have 'C:\Program Files\nodejs' in both my user PATH variable any my system PATH variable.
I've tried running VSCode as Admin on the off chance that would fix it, but that didn't solve anything either.
Thank you for your time, hopefully I'm overlooking something simple due to my inexperience with the terminal.
Leaving VSCode overnight and then rebooting seems to have fixed it. I can't explain why, but if you're encountering the same issue I recommend walking away and coming back to it after a long delay.

When I try to execute 'npx create-next-app', the installation never ends

I'm trying to create a new NextJS app, but the command npx create-next-app <name> never ends. It installs a few files along the way (including node_modules/), then after a while, among all the great lines that a CMD shows, it displays an installation line that never ends. When I try to cancel the installation, I must restart my PC completely.
Note: the last line is always beginning with "reify:something: timing ... Completed in Xms"
My problem
I've tried to reinstall NodeJS, It did not change a single thing.
I've tried to delete the cache, nothing changed.
I have used npm in the past and it always worked fine, I have absolutely no idea why it doesn't work now.
Please help me, I don't know what to do, except to throw my PC out the window.
I'm on Windows 10, using npm 7.24.1 with node v14.17.6
Finally, I fixed my problem thanks to Marcel Herd: I installed WSL 2 and from now on I'll use Ubuntu on Windows to execute npm commands.
However, I have still no idea why I had to do such a thing...
Thank you
If you are interested, here are links that helped me:
https://learn.microsoft.com/en-us/windows/wsl/install
https://learn.microsoft.com/en-us/windows/wsl/setup/environment
https://learn.microsoft.com/fr-fr/windows/dev-environment/javascript/nodejs-on-wsl

strange npm problem, command never finishes, hangs forever

This is windows 10, node-v10.15.3-x64.msi install.
using either command prompt or power shell I type npm and nothing happens and it doesn't bomb or returns to the prompt. Just the little blinking dot that lies to me saying it is doing something. When I stop being fascinated by this blinking dot and hit control c it says Terminate batch job (y/n) ? y gives me back my prompt. Obviously there was some process running but I am not getting a functioning program. Any ideas? I know this is the head scratch kind of problem that does not usually get answered but I can't be so special nobody else has this happen.
What underlying tech does npm rely on? python?
Ok with help from the other thread I got it figured out.
Yes I screwed with prefix to my detriment. The reason why I kept going round and round deleting and reinstalling is I missed .npmrc in my user directory. The prefix in it was set to a path that no longer existed. I deleted my profile .npmrc and it started working again. I have now learned that is the file to edit to set prefix and cache.
Now the structure of the nodejs stock install for npm is bizarre imho. The npm executables are in the nodejs directory. Node itself is installed nodejs/node_modules/npm. The npm modules are path nodejs/node_modules/npm/node_modules.
Initially I changed my personal .npmrc to this contents
prefix="C:\Program Files\nodejs\node_modules\npm"
cache="C:\Program Files\nodejs\node_modules\npm"
This stopped npm from installing into my appdata/roaming directory but it kept bombing because it could not create the cache directories because it was in Program Files
But I was happy because it was trying to install global into one directory instead of my profile roaming. The main reason I started this odyssey is I wanted global modules in ONE location.
So what I did was moving nodejs from program files to another directory.
change my profile .npmrc to this
prefix="C:\nodejs\node_modules\npm"
cache="C:\nodejs\node_modules\npm"
changed the path entry for nodejs in paths in system properties / advanced / environmental variables / system variables / path to C:\nodejs.
I also keep deleting path in the top path in user variables but it seems to keep coming back like Freddy Krueger. Doesn't seem to do any harm now though.
A lot of examples try to set prefix to nodejs\npm. Maybe that was kosher at one time but now the npm executable called npm is in the nodejs root directory.
Okay I am not a tech writer but I hope this will provide clues to other clueless like me. Cheers!

Getting Node to work on windows 7 enterprise

For the better part of a day now I've been trying to get node.js to work on my computer.
Even though I get no errors during installation, whenever i try to run node or npm from the command line I only get the error "Evented I/O for V8 JavaScript has stopped working" and then nothing happens.
I really have no clue why it isn't working and what I have to do to get it to work! Has anyone else ever had the same problem and were you able to fix it somehow?
It seems the problem was with ansicon which I installed together with cucumber.
I was able to fix the problem by running "ansicon -u" in my x64 folder

Meteor isn't working on Windows7 64 bit

I am just trying out Meteor on my Windows 7 enterprise 64 bit box. I installed it via MSI from http://win.meteor.com, rebooted the machine and in command prompt (administrator), did the following:
cd /d c:\var
meteor create testapp
(absolutely no response on console)
Then I insured that node.exe is working. I created a test.js with basic hello world example and it worked (I browsed to the localhost:xxx and was greeted).
node test.js
Then I went right into the meteor.js code, and upon encountering process.stderr.write inside fiber(...), I decided to call the same at the beginning of the file outside fiber.
process.stderr.write("outside fiber");
(this message got printed
; confirmed that there is a problem with fibers)
Now upon research, I stumble upon
npm test fibers
(output: Error: Test already-running.js failed.
code: -1073741819 ....)
Then I did
npm remove fibers
npm install fibers
However, the error with test fiber continues so does the absolute no-output from meteor command.
could anybody help? I'm out of options and this is my first attempt at meteor/nodejs.
I have discovered an issue with node fibers (on windows) and have a tentative fix - at least it fixed the problem for me, and I would be interested to see if that also fixes it for others.
Ultimately the problem was apparently sudden death due stack overflow and access violation. The root cause however was that the thread locals were not correctly being switched on a fiber switch.
Please see https://github.com/TomWij/meteor/issues/66#issuecomment-15994548 for details.
See related Stack Overflow question: Meteor on Windows: meteor command outputs nothing
You need to know that, by now, meteor dont officially support windows.
I can recommend you to try using virtualbox and a linux distro in a virtual machine.

Resources