I am on Windows 10.
Node Js version V10.16.3 is successfully installed. Npm version 9.x ok also.
I was working for several weeks on a vuejs project using Visual Studio Code.
Suddenly 2 days ago, the npm start
command stopped working.
After investigation and having deinstalled and reinstalled nodejs several times (with deletion of directories), I keep ending up with the same problem I'm describing below:
Nodejs REPL console is working fine. When I type process.version > it displays V10.16.3
node -v
ornode --version
display nothing but a blank line in the cmd window.node test.js
(console.log("hello");
) does nothing (no execution at all), except printing a blank line.If I type
node test.js > test.log
: nothing is written to test.log.npm -v
ornpm --help
open several extra windows in the cmd window.The 1st extra window is titled "C:\Program Files\nodejs" and closes straight away.
The 2nd extra window is titled "npm" and closes straight away.Then the prompt goes back to the current cmd window where I typed the command
npm --version
or-v
.Then another cycle starts with:
The 1st extra window is titled "C:\Program Files\nodejs" and closes straight away.
The 2nd extra window is titled "npm" and closes straight away.And finally it comes back to the current cmd window with no output at all except for a blank line.
Sometimes, I can see the version number "9.x" being displayed in one of the npm titled window.
npm -list
does the same with opening of the 4 successive windows, and a list of node modules is displayed in the last one, titled "npm", before the window closes.I checked npm.cmd and it is OK
When I type
node "C:\Program Files\\node_modules\npm\bin\npm-cli.js" -v
, it displays nothing but a blank line.I read all questions and answers in stackoverflow but none is related to my case except this one: npm -version displays nothing, but there is no solution provided.
Can someone help me, please?
C:\Program Files\nodejs> node -v
C:\Program Files\nodejs> npm -v
C:\Program Files\nodejs> node "C:\Program Files\\node_modules\npm\bin\npm-cli.js" -v
I expect to display node version and npm version to be displayed in the current cmd line and I expect node test.js to work and get my "hello" as it was working 2 days ago...
I provide somme complements and details with some screenshots :
1) Node console REPL Node console REPL works correctly
2) Cygwin console Node works with cygwin
3) Powershell console Node -v, npm -v, node script.js execute but in a temporary separate popup window > Before this bug with node cmd > all displays were output directly in the console without popup window
11 silly lifecycle projet-test@1.0.0~dev: Returned: code: 9 signal: null 12 info lifecycle projet-test@1.0.0~dev: Failed to exec dev script 13 verbose stack Error: projet-test@1.0.0 dev:
webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
13 verbose stack Exit status 9 13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:210:5) 13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:210:5) 13 verbose stack at maybeClose (internal/child_process.js:1021:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)