Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Fails to create a site in a Yarn workspace #210

Closed
wichert opened this issue Dec 17, 2017 · 2 comments
Closed

Fails to create a site in a Yarn workspace #210

wichert opened this issue Dec 17, 2017 · 2 comments

Comments

@wichert
Copy link

wichert commented Dec 17, 2017

Is this a bug report?

Yes

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

No - this is specific to Yarn

Which terms did you search for in User Guide?

yarn workspace

Environment

  1. node -v: 9.3.0
  2. npm -v: 5.6.0
  3. yarn --version (if you use Yarn): 1.3.2
  4. npm ls react-scripts-ts (if you haven’t ejected):

Then, specify:

  1. Operating system: macOS 10.13.2
  2. Browser and version (if relevant):

Steps to Reproduce

mkdir test
cd test
cat > package.json <<EOF
{
    "private": true,
    "workspaces": [
        "packages/*"
     ]
}
EOF
mkdir packages
cd packages
create-react-app my-site --scripts-version=react-scripts-ts

Expected Behaviour

New project skeleton is created successfully.

Actual Behavior

It aborts with:

Aborting installation.
Unexpected error. Please report it as a bug:
{ Error: Cannot find module '/private/tmp/zzz/packages/my-site/node_modules/react-scripts-ts/package.json'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at checkNodeVersion (/usr/local/lib/node_modules/create-react-app/createReactApp.js:488:23)
    at getPackageName.then.then.then.packageName (/usr/local/lib/node_modules/create-react-app/createReactApp.js:295:7)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7) code: 'MODULE_NOT_FOUND' }

Deleting generated file... package.json
Deleting my-site / from /private/tmp/zzz/packages
Done.

Which makes sense, since with workspaces enabled yarn will install in ../../node_modules.

@stephtr
Copy link
Contributor

stephtr commented Dec 27, 2017

That bug is not specific to create-react-app-typescript and already tracked in create-react-app#3405.

@DorianGrey
Copy link
Collaborator

@stephtr Thanks for pointing out the original issue.

@wichert Please follow the CRA issue, potential fixes will be merged here once they can be considered 'stable'. I'll close the issue here, since it's not CRA-ts specific.

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

3 participants