question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Space in folder names of local create-react-app copy fails new project creation

See original GitHub issue

Is this a bug report?

I was setting up my local copy of CRA from commit 3e9ba54 https://github.com/facebook/create-react-app/blob/master/CONTRIBUTING.md#setting-up-a-local-copy

This folder is located within a folder which has a name with space on it like Super Folder. So, When I run yarn create-react-app my-app. It fails. Here is the error log:

npm notice 4.9kB  template/src/serviceWorker.js           
npm notice === Tarball Details === 
npm notice name:          react-scripts                           
npm notice version:       2.1.1                                   
npm notice filename:      react-scripts-2.1.1.tgz                 
npm notice package size:  40.9 kB                                 
npm notice unpacked size: 155.3 kB                                
npm notice shasum:        11d20330dc53135dc0cd4d4938260986fb8b37bf
npm notice integrity:     sha512-SjUtl3Q2hxnK1[...]WBiBmQNi6DfdQ==
npm notice total files:   45                                      
npm notice 
internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module '/Users/username/Desktop/Super'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
ERROR! An error was encountered while executing
{ Error: Command failed: node /Users/username/Desktop/Super D/create-react-app/packages/create-react-app/index.js --scripts-version="/Users/username/Desktop/Super D/create-react-app/packages/react-scripts/react-scripts-2.1.1.tgz" my-app
    at checkExecSyncError (child_process.js:600:11)
    at Object.execSync (child_process.js:637:13)
    at Object.<anonymous> (/Users/username/Desktop/Super D/create-react-app/tasks/cra.js:115:4)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 43585,
  stdout: null,
  stderr: null }
Cleaning up.
Exiting with error.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

System:
  OS: macOS High Sierra 10.13.6
  CPU: x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Binaries:
  Node: 10.9.0 - /usr/local/bin/node
  Yarn: 1.9.4 - /usr/local/bin/yarn
  npm: 6.4.1 - /usr/local/bin/npm
Browsers:
  Chrome: 70.0.3538.110
  Safari: 12.0.1
npmPackages:
  @stiligita/react:  1.0.0-0 
  @types/react:  16.7.13 
  @types/react-dom:  16.0.11 
  react:  16.6.3 
  react-dom:  16.6.3 
  react-scripts:  2.1.1 
npmGlobalPackages:
  create-react-app: Not Found

Steps to Reproduce

  1. git clone https://github.com/facebook/create-react-app
  2. yarn
  3. yarn create-react-app my-app

Expected Behavior

I want it to create a new react app successfully.

Actual Behavior

It is broken. Gives Error: Can't find module

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
svikhristyukcommented, Dec 9, 2018

I’m guessing this only affects Windows users not using WSL, which I think is still a large audience.

System:
  OS: macOS High Sierra 10.13.6
2reactions
Brew-Brewcommented, Dec 8, 2018

@mrmckeb I’m doing for this 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Error while creating new React app ("You are running ...
1. First clear the cache · 2. Now run this command, this will uninstall the old version, install the latest one and create...
Read more >
How To Set Up a React Project with Create React App
It will start by making a new project in a directory, which in this tutorial will be called digital-ocean-tutorial .
Read more >
Deployment | Create React App
Sometimes npm run build works locally but fails during deploy via Heroku. Following are the most common cases. "Module not found: Error: Cannot ......
Read more >
Getting started with React - Learn web development | MDN
This brings us to the end of our initial look at React, including how to install it locally, creating a starter app, and...
Read more >
How to fix the Whitescreen After a Static Deployment with ...
Learn how to find out more about the error and fix it. ... If you created your React app with create-react-app, you probably...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found