Cannot run `npm install`: unable to resolve dependency tree - Found: immutable@3.7.6
See original GitHub issueDescription
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® Core™ 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
SOLVED
npm install --legacy-peer-deps
Thanks for the pointer to the npm issue. Please downgrade your Node version/NPM version to LTS and see if it works.