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

Cannot run npm install: unable to resolve dependency tree - Found: immutable@3.7.6 #28925

Closed
zhenghaohe opened this issue Jan 8, 2021 · 9 comments
Labels
status: needs more info Needs triaging and reproducible examples or more information to be resolved status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@zhenghaohe
Copy link

Description

I have a Gatsby package and it was working out fine yesterday but today I tried to start the dev server I got an error.

$ gatsby develop
success open and validate gatsby-configs - 0.051s

 ERROR 


Something went wrong installing the "sharp" module

Module did not self-register: '/Users/zhenghaohe/Desktop/dev/zhenghao.me/node_modules/sharp/build/Release/sharp.node'.

- Remove the "node_modules/sharp" directory, run "npm install" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/
- Search for this error at https://github.com/lovell/sharp/issues


⠋ load plugins
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The terminal process "/bin/bash '-c', 'yarn run develop'" terminated with exit code: 1.

And I nuked the whole node module folder and rerun npm install it showed this error

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: immutable@3.7.6
npm ERR! node_modules/immutable
npm ERR!   immutable@"^3.7.6" from netlify-cms-app@2.9.7
npm ERR!   node_modules/netlify-cms-app
npm ERR!     netlify-cms-app@"^2.9.1" from the root project
npm ERR!     peer netlify-cms-app@"^2.9.0" from gatsby-plugin-netlify-cms@4.1.25
npm ERR!     node_modules/gatsby-plugin-netlify-cms
npm ERR!       gatsby-plugin-netlify-cms@"^4.0.0" from the root project
npm ERR!   immutable@"~3.7.6" from @gatsbyjs/relay-compiler@2.0.0-printer-fix.4
npm ERR!   node_modules/@gatsbyjs/relay-compiler
npm ERR!     @gatsbyjs/relay-compiler@"2.0.0-printer-fix.4" from gatsby@2.16.5
npm ERR!     node_modules/gatsby
npm ERR!       gatsby@"^2.3.25" from the root project
npm ERR!       22 more (gatsby-plugin-feed-mdx, ...)
npm ERR!   5 more (netlify-cms-backend-bitbucket, netlify-cms-lib-auth, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer immutable@">=3.8.1" from slate@0.34.7
npm ERR! node_modules/netlify-cms-widget-markdown/node_modules/slate
npm ERR!   slate@"^0.34.0" from netlify-cms-widget-markdown@2.5.1
npm ERR!   node_modules/netlify-cms-widget-markdown
npm ERR!     netlify-cms-widget-markdown@"^2.5.1" from netlify-cms-app@2.9.7
npm ERR!     node_modules/netlify-cms-app
npm ERR!       netlify-cms-app@"^2.9.1" from the root project
npm ERR!       1 more (gatsby-plugin-netlify-cms)
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.
npm ERR! 

Steps to reproduce

download my repo and npm i https://github.com/zhenghaohe/zhenghao.me

Environment

System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 15.5.1 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 7.4.0 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/local/bin/python
Browsers:
Chrome: 87.0.4280.141
Firefox: 83.0
Safari: 14.0.1
npmPackages:
gatsby: ^2.3.25 => 2.16.5
gatsby-image: ^2.0.39 => 2.2.29
gatsby-plugin-feed-mdx: ^1.0.0 => 1.0.0
gatsby-plugin-google-analytics: ^2.0.18 => 2.1.23
gatsby-plugin-layout: ^1.3.3 => 1.3.3
gatsby-plugin-manifest: ^2.0.29 => 2.2.23
gatsby-plugin-mdx: ^1.2.14 => 1.2.15
gatsby-plugin-netlify-cms: ^4.0.0 => 4.1.25
gatsby-plugin-offline: ^2.0.25 => 2.2.10
gatsby-plugin-react-helmet: ^3.0.12 => 3.1.13
gatsby-plugin-scroll-reveal: ^0.0.7 => 0.0.7
gatsby-plugin-sharp: ^2.0.35 => 2.2.32
gatsby-plugin-smoothscroll: ^1.1.0 => 1.1.0
gatsby-plugin-styled-components: ^3.0.7 => 3.1.11
gatsby-plugin-typography: ^2.2.13 => 2.3.14
gatsby-remark-copy-linked-files: ^2.0.11 => 2.1.28
gatsby-remark-images: ^3.3.9 => 3.3.9
gatsby-remark-responsive-iframe: ^2.1.1 => 2.2.25
gatsby-remark-smartypants: ^2.0.9 => 2.1.14
gatsby-remark-unwrap-images: ^1.0.2 => 1.0.2
gatsby-remark-vscode: 2.1.2 => 2.1.2
gatsby-source-filesystem: ^2.0.29 => 2.1.33
gatsby-transformer-sharp: ^2.1.18 => 2.2.23
npmGlobalPackages:
gatsby-cli: 2.12.38

Run gatsby info --clipboard in your project directory and paste the output here.

@zhenghaohe zhenghaohe added the type: bug An issue or pull request relating to a bug in Gatsby label Jan 8, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 8, 2021
@zhenghaohe zhenghaohe changed the title unable to resolve dependency tree - Found: immutable@3.7.6 Cannot run npm install: unable to resolve dependency tree - Found: immutable@3.7.6 Jan 8, 2021
@RomanHotsiy
Copy link
Contributor

I get a similar warning on the latest npm version:

npm --version
7.3.0
node --version
v15.5.1

May be related to npm/cli#2199

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: type-fest@0.8.1
npm ERR! node_modules/type-fest
npm ERR!   type-fest@"^0.8.1" from boxen@4.2.0
npm ERR!   node_modules/boxen
npm ERR!     boxen@"^4.1.0" from @storybook/core@5.3.21
npm ERR!     node_modules/@storybook/core
npm ERR!       @storybook/core@"5.3.21" from @storybook/react@5.3.21
npm ERR!       node_modules/@storybook/react
npm ERR!         dev @storybook/react@"^5.2.0" from the root project
npm ERR!     boxen@"^4.2.0" from gatsby-telemetry@1.8.0
npm ERR!     node_modules/gatsby-telemetry
npm ERR!       gatsby-telemetry@"^1.8.0" from gatsby@2.30.1
npm ERR!       node_modules/gatsby
npm ERR!         gatsby@"2.30.1" from the root project
npm ERR!         17 more (@redocly/gatsby-plugin-favicon, ...)
npm ERR!       2 more (gatsby-cli, gatsby-plugin-page-creator)
npm ERR!   type-fest@"^0.8.0" from hasha@5.2.2
npm ERR!   node_modules/hasha
npm ERR!     hasha@"^5.2.0" from gatsby@2.30.1
npm ERR!     node_modules/gatsby
npm ERR!       gatsby@"2.30.1" from the root project
npm ERR!       17 more (@redocly/gatsby-plugin-favicon, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional type-fest@"^0.13.1" from @pmmmwh/react-refresh-webpack-plugin@0.4.3
npm ERR! node_modules/@pmmmwh/react-refresh-webpack-plugin
npm ERR!   @pmmmwh/react-refresh-webpack-plugin@"^0.4.1" from gatsby@2.30.1
npm ERR!   node_modules/gatsby
npm ERR!     gatsby@"2.30.1" from the root project
npm ERR!     17 more (@redocly/gatsby-plugin-favicon, ...)
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.

@LekoArts LekoArts added status: needs more info Needs triaging and reproducible examples or more information to be resolved status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 11, 2021
@LekoArts
Copy link
Contributor

Thanks for the pointer to the npm issue. Please downgrade your Node version/NPM version to LTS and see if it works.

@ascorbic
Copy link
Contributor

@zhenghaohe The repo seems to have a yarn.lock, so could you try installing with yarn instead?

@ascorbic
Copy link
Contributor

Hi. I'm going to close this now, as we can't do much to help without a reproduction. If you are able to create a minimal reproduction for this then please do reopen the issue. Thanks!

@AdamAnSubtractM
Copy link

Just to help others, this is a node/npm issue. I use n version manager for node and i always install the latest. Switching back to the the lts version solved it.

@mehov
Copy link

mehov commented Jul 12, 2021

nvm install --lts
nvm use --lts

Source

@ModernArtisan
Copy link

npm ERR! While resolving: cara@0.2.11
npm ERR! Found: gatsby@4.0.2
npm ERR! node_modules/gatsby
npm ERR! gatsby@"^4.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer gatsby@"^2.0.0 || ^3.0.0" from gatsby-plugin-webpack-bundle-analyser-v2@1.1.25
npm ERR! node_modules/gatsby-plugin-webpack-bundle-analyser-v2
npm ERR! gatsby-plugin-webpack-bundle-analyser-v2@"^1.1.22" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry

@ModernArtisan
Copy link

SOLVED

npm install --legacy-peer-deps

@longinteger017
Copy link

works like a charm @ModernArtisan, you are my hero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs more info Needs triaging and reproducible examples or more information to be resolved status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

8 participants