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
  • #5195
Closed
Open
Issue created Oct 01, 2018 by Administrator@rootContributor

npx create-react-app throws error when using in monorepo

Created by: FelixKuehl

Is this a bug report?

Maybe. I know monorepos are not fully supported, however i would expect this to work.

Did you try recovering your dependencies?

Yes

Environment

Node v8.11.3 yarn 1.10.1 npx 6.4.1

Steps to Reproduce

(Write your steps here:)

  1. Create a lerna / yarn workspaces repo
  2. naviagte to packages folder
  3. run create-react-app@next --scripts-version=@next cra-app

Expected Behavior

It should create a new create react app.

Actual Behavior

When running create-react-app@next --scripts-version=@next cra-app, I am getting the following error:

{ Error: Cannot find module '/Users/felixkuehl/cra-monorepo/packages/cra-app/node_modules/react-scripts/package.json'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at checkNodeVersion (/Users/felixkuehl/.npm/_npx/66044/lib/node_modules/create-react-app/createReactApp.js:543:23)
    at getPackageName.then.then.then.packageName (/Users/felixkuehl/.npm/_npx/66044/lib/node_modules/create-react-app/createReactApp.js:344:7)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) code: 'MODULE_NOT_FOUND' }

This could maybe due to yarn workspaces package hoisting.

Workaround is to just run create-react-app@next --scripts-version=@next cra-app outside the monorepo, then delete the node_modules folder and copy the new app into the monorepo. Anyways, keep up the great work! ;)

Assignee
Assign to
Time tracking