Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change absolute path to relative so their compatible with yarn worksp… #3176

Closed
wants to merge 1 commit into from

Conversation

rulonder
Copy link

@rulonder rulonder commented Sep 22, 2017

The previous absolute path was not compatible with yarn workspaces.
I have tested this on windows.
So now it works inside yarn workspaces. I also tested it standalone.

from:
#3031

image
image

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@MikeSuiter
Copy link

@rulonder I copied the change from your PR to my local install of createReactApp.js and tried to create-react-app in both a workspace and external and it fails with this error on Windows.

PS D:\Workspaces\React\workspace\packages> create-react-app app-e

Creating a new React app in D:\Workspaces\React\workspace\packages\app-e.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.2.1
[1/4] Resolving packages...
[2/4] Fetching packages...
warning Pattern ["react@16.0.0"] is trying to unpack in the same destination "C:\\Users\\suim01\\AppData\\Local\\Yarn\\cache\\v1\\npm-react-16.0.0-ce7df8f1941b036f02b2cca9dbd0cb1f0e855e2d" as pattern ["react@^16.0.0","react@^15 || ^16"]. This could result in a non deterministic behavior, skipping.
warning Pattern ["react-dom@16.0.0"] is trying to unpack in the same destination "C:\\Users\\suim01\\AppData\\Local\\Yarn\\cache\\v1\\npm-react-dom-16.0.0-9cc3079c3dcd70d4c6e01b84aab2a7e34c303f58" as pattern ["react-dom@^16.0.0","react-dom@^15 || ^16"]. This could result in a non deterministic behavior, skipping.
info fsevents@1.1.2: The platform "win32" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 6 new dependencies.
├─ app-a@0.1.0
├─ app-b@0.1.0
├─ app-e@0.1.0
├─ react-dom@16.0.0
├─ react-scripts@1.0.14
└─ react@16.0.0
Done in 11.41s.

Aborting installation.
Unexpected error. Please report it as a bug:
{ Error: Cannot find module '..\react-scripts\package.json'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at checkNodeVersion (C:\Users\suim01\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:476:23)
    at getPackageName.then.then.then.packageName (C:\Users\suim01\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:285:7)
    at process._tickCallback (internal/process/next_tick.js:109:7) code: 'MODULE_NOT_FOUND' }

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting app-e / from D:\Workspaces\React\workspace\packages
Done.

Were there any other changes you had to do to get it to work? My workspace configuration looks similar to yours.

{
  "private": true,
  "workspaces": [
    "packages/*"
  ]
}

My CRA is version 1.4.1 and Yarn version 1.2.1

@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants