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

Error adding styled-components as a dependency #66

Open
martinmcneela opened this issue Oct 2, 2020 · 2 comments
Open

Error adding styled-components as a dependency #66

martinmcneela opened this issue Oct 2, 2020 · 2 comments

Comments

@martinmcneela
Copy link

I get the below error regarding eslint-plugin-react when trying to add styled-components as a dependency in components-typescript using yarn workspace @project/components-typescript add styled-components on a freshly cloned version of the repo.

When I try adding 'eslint-plugin-react' is also errors out.

Arguments:
/Users/username/.nvm/versions/node/v12.18.2/bin/node /usr/local/lib/node_modules/yarn/lib/cli.js add eslint-plugin-react

PATH:
/Users/username/.nvm/versions/node/v12.18.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/username/.nvm/versions/node/v12.18.2/bin

Yarn version:
1.22.4

Node version:
12.18.2

Platform:
darwin x64

Trace:
Invariant Violation: expected workspace package to exist for "eslint-plugin-react"
at invariant (/usr/local/lib/node_modules/yarn/lib/cli.js:2314:15)
at _loop2 (/usr/local/lib/node_modules/yarn/lib/cli.js:94976:9)
at PackageHoister.init (/usr/local/lib/node_modules/yarn/lib/cli.js:95035:19)
at PackageLinker.getFlatHoistedTree (/usr/local/lib/node_modules/yarn/lib/cli.js:48743:20)
at PackageLinker. (/usr/local/lib/node_modules/yarn/lib/cli.js:48754:27)
at Generator.next ()
at step (/usr/local/lib/node_modules/yarn/lib/cli.js:310:30)
at /usr/local/lib/node_modules/yarn/lib/cli.js:328:14
at new Promise ()
at new F (/usr/local/lib/node_modules/yarn/lib/cli.js:5301:28)

npm manifest:
{
"name": "@project/components-typescript",
"version": "1.0.0",
"main": "src/index.tsx",
"main:src": "src/index.tsx",
"scripts": {
"test": "react-scripts test",
"lint": "eslint ./src//*.tsx --max-warnings=0 --format=codeframe"
},
"dependencies": {
"@react-workspaces/react-scripts": "3.3.0-alpha-08",
"@storybook/react": "^5.2.8",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/user-event": "^8.0.3",
"@types/jest": "^24.0.25",
"@types/node": "^13.1.6",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.4",
"@typescript-eslint/eslint-plugin": "^2.15.0",
"@typescript-eslint/parser": "^2.15.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.3.0",
"typescript": "~3.7.4"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"jest": {
"collectCoverageFrom": [
"src/
/.{ts,tsx}",
"!src/setupTests.{ts,tsx}",
"!src/serviceWorker.{ts,jsx}",
"!src/**/
.(spec|test|stories).{ts,tsx}"
],
"coverageThreshold": {
"global": {
"statements": 98,
"branches": 98,
"functions": 98,
"lines": 98
}
}
},
"license": "MIT"
}

@zshannon
Copy link

Did you find a fix for this?

@sirganya
Copy link

sirganya commented Feb 5, 2021

Downgrade Yarn.

yarn set version 1.19.0

clean the cache.

yarn cache clean

encounter next set of issues.. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants