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

@astrojs/react is broken on npm install command #10984

Closed
1 task
mika-f opened this issue May 9, 2024 · 6 comments · Fixed by #10986
Closed
1 task

@astrojs/react is broken on npm install command #10984

mika-f opened this issue May 9, 2024 · 6 comments · Fixed by #10986
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@mika-f
Copy link

mika-f commented May 9, 2024

Astro Info

Astro                    v4.8.0
Node                     v18.19.0
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Failed to install @astrojs/react of latest release.

npm run astro add react

> [email protected] astro
> astro add react

✔ Resolving packages...

  Astro will run the following command:
  If you skip this step, you can always run it yourself later

 ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
 │ npm install @astrojs/react@^3.3.3 @types/react@^null @types/react-dom@^null react@^18.3.1 react-dom@^18.3.1  │
 ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

√ Continue? ... yes
✖ Installing dependencies...

 Command failed with exit code 1: npm install @astrojs/react@^3.3.3 @types/react@^null @types/react-dom@^null react@^18.3.1 react-dom@^18.3.1
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "^null" of package "@types/react@^null": Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in: C:\Users\REDACTED\AppData\Local\npm-cache\_logs\2024-05-09T11_58_24_625Z-debug-0.log

Astro could not update your astro.config.js file safely.
Reason: Unable to install dependencies

You will need to add these integration(s) manually.
Documentation: https://docs.astro.build/en/guides/integrations-guide/
  Stack trace:
    at add (file:///C:/a/green-galaxy/node_modules/astro/dist/cli/add/index.js:218:31)
    at async runCommand (file:///C:/a/green-galaxy/node_modules/astro/dist/cli/index.js:117:7)

What's the expected result?

Successfully install it without any errors.

Link to Minimal Reproducible Example

https://github.com/mika-sandbox/astro-add-react-broken

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label May 9, 2024
@bluwy bluwy added - P4: important Violate documented behavior or significantly impacts performance (priority) and removed needs triage Issue needs to be triaged labels May 9, 2024
@bluwy
Copy link
Member

bluwy commented May 9, 2024

Likely due to

"peerDependencies": {
"@types/react": "^17.0.50 || ^18.0.21 || npm:types-react@beta",
"@types/react-dom": "^17.0.17 || ^18.0.6 || npm:types-react-dom@beta",

@Reikon95
Copy link

Reikon95 commented May 9, 2024

Also just started getting this error whenever adding react.

@emish89
Copy link
Contributor

emish89 commented May 9, 2024

Likely due to

"peerDependencies": {
"@types/react": "^17.0.50 || ^18.0.21 || npm:types-react@beta",
"@types/react-dom": "^17.0.17 || ^18.0.6 || npm:types-react-dom@beta",

Yeah, I confirm that removing these 2 npm:types- everything works again.

@emish89
Copy link
Contributor

emish89 commented May 9, 2024

I created this https://github.com/withastro/astro/pull/10986/files

@bluwy bluwy linked a pull request May 9, 2024 that will close this issue
@Reikon95
Copy link

Reikon95 commented May 9, 2024

Screenshot 2024-05-09 at 15 36 10

This seems to have merged but I'm still getting this, even after updating astro

@mika-f
Copy link
Author

mika-f commented May 10, 2024

I confirmed that this problem has been resolved. Thank you for your quick response & release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants