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

Unable to install latest blitz globally with Node 14.16.0 (latest LTS) and latest npm on latest macOS #197

Closed
rodrigoehlers opened this issue Mar 5, 2021 · 2 comments · Fixed by blitz-js/blitz#2091

Comments

@rodrigoehlers
Copy link
Contributor

rodrigoehlers commented Mar 5, 2021

What is the problem?

When running npm i -g blitz on Node.js version 14.16.0 with npm version 7.6.1, the install fails with the following error output.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"^16.6.0 || ^17" from [email protected]
npm ERR!   node_modules/next
npm ERR!     peer next@"*" from [email protected]
npm ERR!     node_modules/blitz
npm ERR!       blitz@"*" from the root project
npm ERR!     next@"10.0.7" from @blitzjs/[email protected]
npm ERR!     node_modules/blitz/node_modules/@blitzjs/core
npm ERR!       @blitzjs/core@"0.31.0" from [email protected]
npm ERR!       node_modules/blitz
npm ERR!         blitz@"*" from the root project
npm ERR!       1 more (@blitzjs/server)
npm ERR!     1 more (babel-plugin-superjson-next)
npm ERR!   peer react@"17.0.1" from [email protected]
npm ERR!   node_modules/react-dom
npm ERR!     peer react-dom@"^16.6.0 || ^17" from [email protected]
npm ERR!     node_modules/next
npm ERR!       peer next@"*" from [email protected]
npm ERR!       node_modules/blitz
npm ERR!         blitz@"*" from the root project
npm ERR!       2 more (@blitzjs/core, babel-plugin-superjson-next)
npm ERR!     peer react-dom@"*" from @testing-library/[email protected]
npm ERR!     node_modules/blitz/node_modules/@testing-library/react
npm ERR!       @testing-library/react@"^11.2.3" from [email protected]
npm ERR!       node_modules/blitz
npm ERR!         blitz@"*" from the root project
npm ERR!     1 more (@next/react-dev-overlay)
npm ERR!   7 more (@blitzjs/core, @testing-library/react, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from [email protected]
npm ERR! node_modules/blitz/node_modules/@blitzjs/core/node_modules/react-query
npm ERR!   react-query@"2.5.12" from @blitzjs/[email protected]
npm ERR!   node_modules/blitz/node_modules/@blitzjs/core
npm ERR!     @blitzjs/core@"0.31.0" from [email protected]
npm ERR!     node_modules/blitz
npm ERR!       blitz@"*" from the root project
npm ERR!     1 more (@blitzjs/server)
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

If re-trying with --legacy-peer-deps as suggested, it works.

This could have something to do with the way peer dependencies are handled in the new npm major version 7.y.z+.

What are detailed steps to reproduce this?

See section "What is the problem?".

Run blitz -v and paste the output here:

After installing with --legacy-peer-deps and deliberately not running in a blitz project folder.

You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

macOS Big Sur | darwin-x64 | Node: v14.16.0

blitz: 0.30.6 (global)

  Package manager: npm 
  System:
    OS: macOS 11.2.2
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
    Memory: 1.27 GB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
    Yarn: Not Found
    npm: 7.6.1 - ~/.nvm/versions/node/v14.16.0/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: Not Found
    blitz: Not Found
    prisma: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: Not Found


Notice blitz version being printed as 0.30.6 though running npm list -g --depth=0 prints the following.

/Users/rodrigoehlers/.nvm/versions/node/v14.16.0/lib
├── [email protected]
└── [email protected]
@flybayer
Copy link
Member

flybayer commented Mar 5, 2021

Yeah, we need to remove peerDependencies from pkg json and use patch-package to patch manypkg so that it doesn't use peerDeps.

@aidan-rypens
Copy link

aidan-rypens commented Mar 6, 2021

Same problem here on Windows, Node v15.11.0. With the suggestion --legacy-peer-deps it works.

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