Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #9644
Closed
Open
Issue created Sep 14, 2020 by Administrator@rootContributor

'react-scripts start' does not work on linux (WSL)

Created by: Asim-Sheikh

Describe the bug

On linux (WSL) npm run start fails with the following error spawn powershell.exe ENOENT

Not sure why its trying to spawn powershell on Linux but this seem to have been introduced from version 3.0.0 of react-scripts. The workaround is to downgrade react-scripts to 2.1.8

This is reproducible on a fresh install using latest npm version 6.14.8 and latest nodejs verison 14.10.1 (also reproducible on 10.x)

Did you try recovering your dependencies?

Reproducible on a fresh install so unlikely its related to corrupt dependencies.

Environment

System:
    OS: Linux 4.19 Ubuntu 20.04.1 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  Binaries:
    Node: 14.10.1 - /usr/bin/node
    Yarn: Not Found
    npm: 6.14.8 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    react: ^16.13.1 => 16.13.1 
    react-dom: ^16.13.1 => 16.13.1 
    react-scripts: 2.1.8 => 2.1.8 
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. npx create-react-app hello-world
  2. cd hello-world
  3. npm run start

Note: This is reproducible at least on Linux (WSL - Ubuntu), it maybe reproducible on Linux generally but I have not tested.

Expected behavior

Compiled successfully!

You can now view hello-world in the browser.

  Local:            http://localhost:3000/
  On Your Network:  http://172.31.234.113:3000/

Note that the development build is not optimized.
To create a production build, use npm run build.

Actual behavior

Starting the development server...

events.js:291
      throw er; // Unhandled 'error' event
      ^

Error: spawn powershell.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:464:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:464:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn powershell.exe',
  path: 'powershell.exe',
  spawnargs: [
    '-NoProfile',
    '-NonInteractive',
    '–ExecutionPolicy',
    'Bypass',
    '-EncodedCommand',
    'UwB0AGEAcgB0ACAAIgBgACIAaAB0AHQAcAA6AC8ALwBsAG8AYwBhAGwAaABvAHMAdAA6ADMAMAAwADAAYAAiACIA'
  ]
}

Reproducible demo

This can be reproduced on a newly created project so demo project is not relevant.

Assignee
Assign to
Time tracking