Reputation: 83
When I try to run npm start just after creating application with npx create-react-app, it does anything and exits with code 0.
When I try to execute npm start command, I get the following message:
C:\projects\novo-curriculo\ui>npm start
> [email protected] start C:\projects\novo-curriculo\ui
> react-scripts start
When I enable --verbose options, I receive the following logs, which are useless too.
C:\projects\novo-curriculo\ui>npm start --verbose
npm info it worked if it ends with ok
npm verb cli [
npm verb cli 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\gabriel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'start',
npm verb cli '--verbose'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm verb run-script [ 'prestart', 'start', 'poststart' ]
npm info lifecycle [email protected]~prestart: [email protected]
npm info lifecycle [email protected]~start: [email protected]
> [email protected] start C:\projects\novo-curriculo\ui
> react-scripts start
npm verb lifecycle [email protected]~start: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~start: PATH: C:\Users\gabriel\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\projects\novo-curriculo\ui\node_modules\.bin;C:\Python38\Scripts\;C:\Python38\;C:\Python27\;C:\Python27\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\ProgramData\chocolatey\bin;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Program Files\nodejs\;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\gabriel\AppData\Local\Microsoft\WindowsApps;C:\Users\gabriel\AppData\Local\Programs\Microsoft VS Code\bin;C:\xampp\php\;C:\Users\gabriel\AppData\Local\ComposerSetup\bin;C:\Users\gabriel\AppData\Roaming\Composer\vendor\bin;C:\Program Files\MySQL\MySQL Workbench 8.0 CE\;C:\sqlite\;C:\Users\gabriel\AppData\Local\Android\Sdk\platform-tools;C:\Users\gabriel\AppData\Local\Android\Sdk\emulator;C:\Users\gabriel\Anaconda3;C:\Users\gabriel\Anaconda3\Scripts;c:\flutter\bin;C:\Users\gabriel\AppData\Roaming\npm
npm verb lifecycle [email protected]~start: CWD: C:\projects\novo-curriculo\ui
npm info lifecycle [email protected]~poststart: [email protected]
npm verb exit [ 0, true ]
npm timing npm Completed in 701ms
npm info ok
Here you can see my package.json:
{
"name": "novo-curriculo-ui",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
The npm configuration:
C:\projects\novo-curriculo\ui>npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.14.5 node/v12.16.3 win32 x64"
; userconfig C:\Users\gabriel\.npmrc
ignore-scripts = false
; builtin config undefined
prefix = "C:\\Users\\gabriel\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\projects\novo-curriculo\ui
; HOME = C:\Users\gabriel
; "npm config ls -l" to show all defaults.
And the npm global configuration.
C:\projects\novo-curriculo\ui>npm config -g list
; cli configs
global = true
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.14.5 node/v12.16.3 win32 x64"
; userconfig C:\Users\gabriel\.npmrc
ignore-scripts = false
; builtin config undefined
prefix = "C:\\Users\\gabriel\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\projects\novo-curriculo\ui
; HOME = C:\Users\gabriel
; "npm config ls -l" to show all defaults.
I've spend all the day trying to solve this issue, but without success. Does anybody else having this also?
My system information is the following and I've tried to run this on command prompt (cmd) and Power Shell - both with the same results.
Thank you.
Upvotes: 2
Views: 1966
Reputation: 29010
I've helped @Gabriel to debug the issue, and I have to say, it's a really weird one.
First, the immediate workaround: Renaming the folder novo-curriculo
fixes it. (Note that this is not the project folder itself, that would be my-ui
, but one above it.)
The real answer is: The application "Warsaw" is interfering with your app.
It's a piece of software by GAS Tecnologica/Diebold/Nixdorf, a "protection module" used by some Brazilian banks to somehow protect their online banking access from malware on the computer. Uninstalling it fixes the issue (and possibly some other issues on the computer as well). Just go to "Add/Remove Programs" and look for "Warsaw" and remove it.
(This is not the first time that this protection module caused issues, by the way. In 2015 it caused IPv6 connections to break.)
The technical explanation, as far as I was able to figure it out, is as follows:
First we have to know that npm start
causes a chain of subprocesses to be spawned here.
node "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" start
node "C:\projects\novo-curriculo\my-ui\node_modules\.bin\react-scripts" start
node "C:\projects\novo-curriculo\my-ui\node_modules\.bin\..\react-scripts\bin\react-scripts.js" start
The last one failed to start. And it did so in a really weird way: The process was created but immediately exited, with "success" - exit code zero. So, no error was shown, nothing out of the ordinary other than just the process immediately exiting.
It can be seen here in Process Monitor:
What's shown here is that immediately after the process starts (it just loaded ntdll.dll
and didn't even load any of the other DLL dependencies yet) it quits. This is highly unusual.
But it gets even more mysterious, because manual testing revealed that node node_modules\react-scripts\bin\react-scripts.js start
would work fine, while node "C:\projects\novo-curriculo\my-ui\node_modules\react-scripts\bin\react-scripts.js start"
would not.
Playing around with the command line showed that it has nothing to do with the actual physical folders or files involved. node --version
normally prints the node.js version, even if followed by another argument, say node --version abcdefg
. However, as soon as I put an argument that contained the pattern \*novo-curriculo*\*.js
(and the executable was node
), it exited without printing the version! For example, node --version \1111novo-curriculo1111\1111.js
.
Trying to debug the node process in x64dbg made it obvious that some unknown external force closed the process as soon as it was started, because even if x64dbg broke into the process at the point ntdll
was loaded, it was already gone by the time the disassembly was loaded, and trying to execute a single instruction immediately resulted in "debugging stopped", with the processing having died with exit code zero.
Therefore it must have been some sort of mechanism, probably a kernel driver or a service, that terminates processes as soon as they start if their command line matches certain patterns. That would sound like either a piece of malware (a rootkit scan came back clean though), or anti-virus (which wasn't the case since the only anti-virus in play was Windows Defender), or some sort of (badly programmed) anti-cheat system of some game. Turned out the last one was almost right - it was the online banking protection system!
So, bottom line: This Warsaw "protection module" for online banking (which should supposedly protect you from spyware while you are using online banking) is badly programmed and can terminate other processes without any obvious reason (when their command line matches some sort of pattern) and without giving any warning or message about it.
Upvotes: 2
Reputation: 845
npm install
Upvotes: 1
Reputation: 53538
Let's get back to basics: create-react-app
is generally installed globally because it's a project builder, not "a library", so I've got this working just fine using the following steps:
D:\temp>npm install -g create-react-app
[...create-react-app install log]
D:\temp>create-react-app test
Creating a new React app in D:\temp\test.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
[...bootstrapping log...]
We suggest that you begin by typing:
cd test
npm start
Happy hacking!
So that's straight forward: it's telling us what to do:
D:\temp>cd test
D:\temp\test>npm start
> [email protected] start D:\temp\test
> react-scripts start
[ screen wipe ]
Compiled successfully!
You can now view test in the browser.
http://localhost:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
So this works just fine: what steps did you perform that differ form these?
Upvotes: 0