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.

CRA dev dependency warning with yarn workspaces with react-scripts@2.0.0

See original GitHub issue

Is this a bug report?

YES

Did you try recovering your dependencies?

YES yarn 1.5.1

Which terms did you search for in User Guide?

Environment

  1. node -v: 8.9.3
  2. npm -v:
  3. yarn --version (if you use Yarn): 1.5.1
  4. npm ls react-scripts (if you haven’t ejected): 2.0.0-next.b2fd8db8

Then, specify:

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

Steps to Reproduce

(Write your steps here:) Create app1 (express) with devdependencies: “devDependencies”: { “babel-jest”: “22.4.3”, “eslint”: “4.19.1”, “jest”: “22.4.3” }, Create app2 (CRA)

Expected Behavior

yarn start succeeds

Actual Behavior

There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

“jest”: “22.1.2”

Don’t try to install it manually: your package manager does it automatically. However, a different version of jest was detected higher up in the tree:

root/node_modules/jest (version: 22.4.3)

Reproducible Demo

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
bugzpoddercommented, May 3, 2018

there were a bunch of configuration issues when I tried to configure various projects. So at the end of the day I feel this warning is justified.
I ended up hoisting the packages suggested in the warning: jest specifically to get around this problem babel because of incompatibility issues for babel-loader with babel 7 and jest eslint for plugin errors I didn’t find any issues with webpack so far. — In root/package.json —

"workspaces": {
    "packages": [...],
    "nohoist": ["**/babel**", "**/eslint**", "**/jest"]
 }
1reaction
devrelmcommented, Oct 31, 2018

@Timer Can you expand on why this issue is closed? I’m still seeing it. We have a monorepo holding multiple CRA v1 apps and would prefer to not have to upgrade them all at once, but we’re seeing issues with a CRA v2 app exiting after warning about babel-jest being “detected higher up in the tree”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CRA and Yarn Workspace - Medium
Typescript; Create React App to set up a web app; Yarn workspace. ... devDependencies : I move all development dependencies to the root ......
Read more >
yarn workspaces shared package does not load in create ...
I tried to add dependency "@app/shared": "1.2102.0" into packages/frontend/package.json , but it was not helpful. Yarn does not spit any error ...
Read more >
Building Scalable Front-end With Lerna, YARN And React In ...
Lerna already provides it so why go with YARN workspaces? ... This helps in faster delivery of new modules since developers don't get...
Read more >
react-scripts-yarn-workspace - npm package - Snyk
All security vulnerabilities belong to production dependencies of direct and indirect packages. License: MIT. Security Policy: Yes ...
Read more >
Sharing components using a monorepo built with Lerna and ...
It sets up 2 CRA projects and one shared project for code sharing. ... Install lerna as a dev dependency. yarn add lerna...
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