GPlates / gplates-app

GPlates Mobile App

Home Page:https://www.gplates.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

initialization problem

yiyanw opened this issue · comments

when I re-run "npm install", it got dependencies conflict:

$ npm install
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: gplates-in-schools@0.0.1
npm WARN Found: react-scripts@4.0.3
npm WARN node_modules/react-scripts
npm WARN   dev react-scripts@"^5.0.1" from the root project
npm WARN   2 more (@craco/craco, @craco/craco)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-scripts@"^4.0.0" from @craco/craco@6.4.5
npm WARN node_modules/@craco/craco
npm WARN   @craco/craco@"^6.4.3" from the root project
npm WARN   1 more (craco-cesium)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: gplates-in-schools@0.0.1
npm WARN Found: react-scripts@4.0.3
npm WARN node_modules/react-scripts
npm WARN   dev react-scripts@"^5.0.1" from the root project
npm WARN   2 more (@craco/craco, @craco/craco)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-scripts@"^4.0.0" from @craco/craco@6.4.5
npm WARN node_modules/@craco/craco
npm WARN   @craco/craco@"^6.4.3" from the root project
npm WARN   1 more (craco-cesium)

added 193 packages, removed 481 packages, changed 312 packages, and audited 1926 packages in 42s

219 packages are looking for funding
  run `npm fund` for details

14 high severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

I tried to run "npm install --force" to avoid this issue, but cesium.js had other problem when running "npm start":

[react-scripts] ERROR in ./node_modules/cesium/Source/Core/Resource.js 1843:30-44
[react-scripts] Module not found: Error: Can't resolve 'zlib' in 'D:\project\GPlates\gplates-app\node_modules\cesium\Source\Core'
[react-scripts] BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
[react-scripts] This is no longer the case. Verify if you need this module and configure a polyfill for it.
[react-scripts] If you want to include a polyfill, you need to:
[react-scripts]         - add a fallback 'resolve.fallback: { "zlib": require.resolve("browserify-zlib") }'
[react-scripts]         - install 'browserify-zlib'
[react-scripts] If you don't want to include a polyfill, you can use an empty module like this:
[react-scripts]         resolve.fallback: { "zlib": false }
[react-scripts] ERROR in ./node_modules/cesium/Source/Core/Resource.js 1847:39-54
[react-scripts] Module not found: Error: Can't resolve 'https' in 'D:\project\GPlates\gplates-app\node_modules\cesium\Source\Core'
[react-scripts] BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
[react-scripts] This is no longer the case. Verify if you need this module and configure a polyfill for it.
[react-scripts] If you want to include a polyfill, you need to:
[react-scripts]         - add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
[react-scripts]         - install 'https-browserify'
[react-scripts] If you don't want to include a polyfill, you can use an empty module like this:
[react-scripts]         resolve.fallback: { "https": false }
[react-scripts] ERROR in ./node_modules/cesium/Source/Core/Resource.js 1847:57-71
[react-scripts] Module not found: Error: Can't resolve 'http' in 'D:\project\GPlates\gplates-app\node_modules\cesium\Source\Core'
[react-scripts] BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
[react-scripts] This is no longer the case. Verify if you need this module and configure a polyfill for it.
[react-scripts] If you want to include a polyfill, you need to:
[react-scripts]         - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
[react-scripts]         - install 'stream-http'
[react-scripts] If you don't want to include a polyfill, you can use an empty module like this:
[react-scripts]         resolve.fallback: { "http": false }
[react-scripts] webpack compiled with 3 errors

I did some searching on it, there is a solution that we can degrade react-scripts to 4.0.x to solve this problem. However, more problems appear.

So I think I better post it to check whether someone else has the same issue, or I did something wrong with project settings.

I know it's not ideal, but I've been using --force. That's working for me. Maybe try deleting package-lock.json and node_modules and trying again?

Try npm install --legacy-peer-deps or use node 16

I tried --force, --legacy-peer-deps, and delete package-loack.json, also I use node V16.17.1. However, the cesium.js report the same error " Module not found: Error: Can't resolve 'xxx' ". I will continuously try on it, please let me know if you have any new ideas. @michaelchin @matthew-merkas

I checked package.json, the current cesium version is ^1.95.0. the version in node_modeles is 1.98.1. Which version I should use? @michaelchin

@michaelchin it works on 1.95.

Btw, Eslint has error "ESLint: TypeError: this.libOptions.parse is not a function". This can be solved by downgrading to 8.22.x or earlier.