Skip to content

Error adding styled-components as a dependency #66

Description

@martinmcneela

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"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions