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
  • #3405
Closed
Open
Issue created Nov 03, 2017 by Administrator@rootContributor

Cannot use CRA to create a new yarn workspace/package

Created by: mattfysh

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

No

Which terms did you search for in User Guide?

  • "Yarn workspaces"
  • "hoisting"

Environment

  1. node -v: v8.7.0
  2. npm -v: 5.5.1
  3. yarn --version (if you use Yarn): 1.2.1
  4. npm ls react-scripts (if you haven’t ejected): N/A (happens on init)

Then, specify:

  1. Operating system: macOS Sierra v10.12.6
  2. Browser and version (if relevant):

Steps to Reproduce

(Write your steps here:)

  1. mkdir cra-issue && cd cra-issue
  2. create a package.json using this:
{
  "private": true,
  "workspaces": [
    "packages/*"
  ],
  "devDependencies": {
    "husky": "^0.14.3"
  }
}
  1. yarn
  2. create-react-app packages/app-a

Expected Behavior

A new CRA application to be initialized under packages/app-a

Actual Behavior

...
Aborting installation.
  Unexpected error. Please report it as a bug:
  { Error: Cannot find module '/Users/cra/Projects/sandbox/repro/packages/workspace-a/node_modules/react-scripts/package.json'
      at Function.Module._resolveFilename (module.js:527:15)
      at Function.Module._load (module.js:476:23)
      at Module.require (module.js:568:17)
      at require (internal/module.js:11:18)
      at checkNodeVersion (/Users/cra/.config/yarn/global/node_modules/create-react-app/createReactApp.js:488:23)
      at getPackageName.then.then.then.packageName (/Users/cra/.config/yarn/global/node_modules/create-react-app/createReactApp.js:295:7)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7) code: 'MODULE_NOT_FOUND' }

  Deleting generated file... node_modules
  Deleting generated file... package.json
  Deleting workspace-a / from /Users/cra/Projects/sandbox/repro/packages
  Done.

Reproducible Demo

Use steps above

Assignee
Assign to
Time tracking