Comments (12)
I would expect the npm install command to be @^7
and not @7.0.0
or @7.4.0
- that seems like a bug.
from install-peerdeps.
You could use ^3.8
for that tho, any reason you’re not?
from install-peerdeps.
@ljharb I think ^3.8
would still get parsed into @3.8.0
, which is a non-existent version. Regardless of the semver syntax, my point is that this tool should handle whatever that is considered valid in a package.json
file.
from install-peerdeps.
BTW, my workaround to this issue seems to completely obviate the need for install-peerdeps
:
npm info <package> peerDependencies --json | jq -r 'keys[] as $k | "\($k)@\"\(.[$k])\""' | xargs npm install --save-dev
from install-peerdeps.
No, it wouldn’t - the caret is an identical (and simpler and more widely understood) range than the one you have.
from install-peerdeps.
I think I have a similar case where ^7
is transformed to 7.0.0
instead of the latest in the 7.x branch.
Example:
❯ npx install-peerdeps --dev @wordpress/eslint-plugin --dry-run
install-peerdeps v2.0.3
This command would have been run to install @wordpress/eslint-plugin@latest:
npm install @wordpress/[email protected] [email protected] --save-dev --registry https://registry.npmjs.org
I'm expecting to get [email protected] here. Is that expectation incorrect?
from install-peerdeps.
Yeah, I believe this is a bug - I think it may be causing facebook/create-react-app#10465 reported by @uebriges.
from install-peerdeps.
Just tested with @uebriges, and it seems this is indeed a problem.
We tested on a Windows 10 machine - not sure if this is a relevant detail.
Failing Repro
Reproduction 1 uses install-peerdeps
to install the peer dependencies of eslint-config-react-app
. When react-scripts start
is run using yarn start
, create-react-app
crashes, saying that the versions of babel-eslint
and eslint
do not match the version from react-scripts
.
mkdir reproduction
cd reproduction
npx create-react-app .
npx install-peerdeps --yarn --dev eslint-config-react-app
yarn start
Succeeding Repro
Reproduction 2 uses a manual yarn add --dev
installation command to install the version ranges from the package.json
for eslint-config-react-app
. The start
script runs without any problems:
mkdir reproduction-two
cd reproduction-two
npx create-react-app .
yarn add --dev eslint-config-react-app @typescript-eslint/eslint-plugin@^4.0.0 @typescript-eslint/parser@^4.0.0 babel-eslint@^10.0.0 eslint@^7.5.0 eslint-plugin-flowtype@^5.2.0 eslint-plugin-import@^2.22.0 eslint-plugin-jsx-a11y@^6.3.1 eslint-plugin-react@^7.20.3 eslint-plugin-react-hooks@^4.0.8 eslint-plugin-jest@^24.0.0
yarn start
from install-peerdeps.
@karlhorky really appreciate your testing here, glad we're squashing all these bugs! Opened #126 which should hopefully fix -- can you let me know if that works for you?
from install-peerdeps.
Sure! @uebriges and I will test: #126 (comment)
from install-peerdeps.
Ah seems like this solution in #126 doesn't work after all (installing the eslint-config-react-app
peer deps in a new create-react-app
project with [email protected]
just failed on Windows).
You can see this with this example dependency:
eslint-config-react-app
"@typescript-eslint/parser": "^4.0.0",
Source: https://unpkg.com/browse/[email protected]/package.json
Installed via [email protected]
"@typescript-eslint/parser": "4.0.0",
Latest version of @typescript-eslint/parser
4.14.2
Source: https://www.npmjs.com/package/@typescript-eslint/parser
Let me know if I should open a new issue for this.
from install-peerdeps.
same problem on a Windows 11 machine
from install-peerdeps.
Related Issues (20)
- 'request' package needs to be replaced
- ERR spawn npm ENOENT HOT 21
- Fix issue with `child_process.spawn` on Windows
- Move tests to GitHub Actions, add Windows Tests HOT 11
- `ERR undefined` with v3.0.1 when running on Windows 10 HOT 5
- Feature request: Install from package.json
- Do we have the actual source code for this tool? HOT 3
- Cannot read property 'forEach' of undefined HOT 8
- should not error when there are no peer dependencies; just quietly install the package and move on HOT 3
- ERR: undefined when installing eslint-config-airbnb HOT 7
- --no-registry flag does not work HOT 2
- ERR Unexpected end of JSON input HOT 6
- `@babel/polyfill` warning HOT 3
- Install peer deps using absolute url
- `ERR undefined` with v3.0.3 install-peerdeps HOT 4
- Feature Request: Add ability to ignore some peerDependencies HOT 4
- load package version failure when using yarn@3
- --no-registry not work HOT 1
- install-peerdeps `ERR undefined` on windows HOT 6
- Support --ignore-scripts flag
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from install-peerdeps.