Yeoman generator works except on Windows 10 with Node 10 - node.js

I have a generator that works on Ubuntu, Mac, and Windows 10 with Node 8.
It also (reportedly) runs on Win10 with Node 10 when run on either mintty.exe or Git bash from the git package (https://git-scm.com/download/win).
However it hangs when run on Win10 with Node 10 on either PowerShell or command.exe.
The "prompting" method runs fine and the "this.prompt" promise resolves OK. The problem is the "writing" method" is never run.
You can see the problem by going to an empty folder and running
npm i -g #feathers-plus/cli
set DEBUG=gen*
feathers-plus generate app
and pressing Enter on all the prompts.
You can see https://github.com/feathers-plus/generator-feathers-plus/blob/master/generators/app/index.js#L173 is run, but not https://github.com/feathers-plus/generator-feathers-plus/blob/master/generators/app/index.js#L178 .
Before I start digging into the Yeoman source, has anyone run into something similar, does anyone have any thoughts on what the issue may be, any thoughts on how to proceed? Thanks in advance.

Related

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

npm run build on windows 10 gives This app can't run on your PC

Trying to run the command npm run build on my system but keep getting this
error. Tried uninstalling node but no luck. Any pointers would be helpful
The issue for me was that I am using nvm, and for reasons I don't yet know, when I try to set my node version to 12.14.0, and then run nvm list, no versions are selected. I went back to 13.8.0 and nvm list showed that 13.8.0 was selected.
Long story short, make sure you have a selected node version.
you should follow one of two option:
Option 1 – Setup by running the .msi installation file
Its a typical Windows installation and automated.
No need to add entries in environment varaiable
Option 2 – Setup by extracting .zip file
This method does not require admin access and can be used to install on nodejs on a system on which you dont have admin access such as you official laptop or desktop.
Removing nodejs is as simple as deleting the folder.
You will have to add entries in environment variable if you want to execute node command from any location in windows command prompt.
See the link below for more details : install Node.js and NPM on Windows 10

Locally installed executable dependencies fail using npm run/yarn run on Windows

I am using a Windows machine as my primary development machine. I usually use WSL for most of my projects, but one of my electron projects requires me to work in the Windows environment. So I've set up node, npm, yarn & git on the Windows side as well. But I am having troubles with locally installed dependencies.
Say, I have added concurrently to my project using yarn add concurrently. Now if I do yarn run concurrently, it fails saying that 'C:\Users\Praneet\Projects\my-project\node_modules\.bin\concurrently' is not recognized as an internal or external command. But if I do yarn run concurrently.cmd, it works. Same thing happens for scripts in package.json. I have to change react-scripts start to react-scripts.cmd start to make it work. But I don't want to do this for every script, because there are other devs working with me who use MacOS. I will be really grateful if someone could help me with this.
Have you tried running these commands using Windows Powershell? It might work.
Another option (the one I use when I must code in a Windows environment) is to use Git Bash: https://gitforwindows.org/
It simulates a BASH for Windows, so the commands you are trying to run should work without the .cmd.

Node isn't recognized

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

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

Resources