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

Error when calling npm start or yarn start #2661

Closed
hudibrian opened this issue Jun 28, 2017 · 12 comments
Closed

Error when calling npm start or yarn start #2661

hudibrian opened this issue Jun 28, 2017 · 12 comments

Comments

@hudibrian
Copy link

hudibrian commented Jun 28, 2017

Hello, I have been trying to create and work on an app and I have done an npm install -g create-react-app, and then executed create-react-app testName, and it finished successfully. But when I cd in to the project and run npm start or yarn start it fails with the following errors:

I'm having trouble interpreting the error logs, so if anyone has an idea I would appreciate it!

npm start:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@4.6.1
3 info using node@v6.11.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle test@0.1.0~prestart: test@0.1.0
6 silly lifecycle test@0.1.0~prestart: no script for prestart, continuing
7 info lifecycle test@0.1.0~start: test@0.1.0
8 verbose lifecycle test@0.1.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle test@0.1.0~start: PATH: C:\Users\bhudi\AppData\Roaming\nvm\v6.11.0\node_modules\npm\bin\node-gyp-bin;C:\repos\test\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\Best Practices Analyzer\;C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\TortoiseGit\bin;C:\Go\bin;";.";C:\Program Files\Git\cmd;C:\Program Files (x86)\Yarn\bin;C:\Users\bhudi\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\bhudi\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\bhudi\AppData\Local\Yarn\bin;"C:\Users\bhudi\AppData\Local\Programs\Python\Python36-32\;C:\Users\bhudi\AppData\Local\Programs\Python\Python36-32\\Lib;C:\Users\bhudi\AppData\Local\Programs\Python\Python36-32\\DLLs;C:\Users\bhudi\AppData\Local\Programs\Python\Python36-32\\Lib\lib-tk;C:\Users\bhudi\AppData\Roaming\nvm;C:\Program Files\nodejs
10 verbose lifecycle test@0.1.0~start: CWD: C:\repos\test
11 silly lifecycle test@0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
12 silly lifecycle test@0.1.0~start: Returned: code: 3221225477  signal: null
13 info lifecycle test@0.1.0~start: Failed to exec start script
14 verbose stack Error: test@0.1.0 start: `react-scripts start`
14 verbose stack Exit status 3221225477
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\bhudi\AppData\Roaming\nvm\v6.11.0\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\bhudi\AppData\Roaming\nvm\v6.11.0\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:891:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid test@0.1.0
16 verbose cwd C:\repos\test
17 verbose Windows_NT 10.0.15063
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 verbose node v6.11.0
20 verbose npm  v4.6.1
21 error code ELIFECYCLE
22 error errno 3221225477
23 error test@0.1.0 start: `react-scripts start`
23 error Exit status 3221225477
24 error Failed at the test@0.1.0 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 3221225477, true ]

yarn start:

yarn start v0.24.6
$ react-scripts start
error Command failed with exit code 3221225477.

*note: I use nvm and have tried with multiple versions, and nothing has helped. I've also uninstalled node and reinstalled, cleared cache, but it doesn't seem to work.

  1. node -v: 6.11.0
  2. npm -v: 4.6.1
  3. yarn --version: 0.24.6
  4. npm ls react-scripts: react-scripts@1.0.7

Then, specify:

  1. Operating system: windows 10

Steps to Reproduce

  1. npm install -g create-react-app
  2. create-react-app test
  3. cd test
  4. npm start or yarn start

Expected Behavior

Expected it to host the app at localhost:3000

Actual Behavior

npm start snip
yarn-start

Package Json

{
  "name": "brianhudi.rocks",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^15.6.1",
    "react-dom": "^15.6.1"
  },
  "devDependencies": {
    "react-scripts": "^1.0.7"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

@gaearon
Copy link
Contributor

gaearon commented Jun 28, 2017

Thanks for the report.

This seems like some sort of Node/Windows compatibility issue.
Unfortunately it means this is extremely unlikely that we can fix it on our side.

As noted in sass/node-sass#1283 (comment) and npm/npm#11024 (very similar symptoms), it might be related to unusual Windows system permissions, an antivirus running, or something like this.

The specific symptom is that neither Yarn nor npm seem to be able to spawn a process.
I recommend you to file a bug with Node.js.

I'm very sorry about closing this but it's just not possible to fix here.

@DanielWLam
Copy link

+1, however, vue-cli just such a great boilerplate, which doesn't come across such problem...

@oNexiaoyao
Copy link

+1, I have this problem too.the problem is same as what hudibrian described. Is there any solution to this problem ?

@gaearon
Copy link
Contributor

gaearon commented Aug 19, 2017

Not that I'm aware of. You could try reinstalling Node, disable any antivirus software, login as system administrator, or run some tool to repair disk permissions.

@zaycode
Copy link

zaycode commented Nov 16, 2017

after you install the new dependency,
you must run : npm install

@MichaelWalker-git
Copy link

i deleted my node_module folder and did yarn install. I also rollbacked my npm and yarn versions to more stable versions.

@mathysd
Copy link

mathysd commented Mar 14, 2018

Probably not related at all to the OP issue. But in case anyone is using windows containers and is trying to build a cra from within in the container and stumbles on this error. Like I did. I fixed it by setting the memory limit to 2048mb instead of the default 1024mb.

docker run -m 2048mb ...

docker windows memory

@hudibrian
Copy link
Author

Sorry for being silent on this issue since I created it. I wasn't able to exactly pinpoint the issue but it seemed to be related to my companies access restrictions on my PC and or their antivirus.

Shortly after experiencing this issue I moved to a macbook from my windows machine, and it has worked just fine on the mac side, and in parallels on windows 10. That being said, I installed the copy of windows that is running in parallels and have full administrator rights and choice of AV and whether or not it is running.

@belhassen07
Copy link

did anyone got a solution for this? I tried using other node version , and shutdown the antivirus, that didn't work.

@edant92
Copy link

edant92 commented Mar 19, 2018

I've followed the same steps as @belhassen07 and got the same errors too...

@idropmybrain
Copy link

deleting node modules helped in my case.

@staufenberg
Copy link

staufenberg commented Oct 21, 2018

after you install the new dependency,
you must run : npm install

strrriiikkkkeee :-) via npm install (call it where the package.json file is located in your example folder)

@lock lock bot locked and limited conversation to collaborators Jan 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests