GPlates / gplates-app

GPlates Mobile App
https://www.gplates.org
2 stars 0 forks source link

initialization problem #176

Closed yiyanw closed 1 year ago

yiyanw commented 1 year ago

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.

yiyanw commented 1 year ago

@michaelchin @matthew-merkas

matthew-merkas commented 1 year ago

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?

michaelchin commented 1 year ago

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

yiyanw commented 1 year ago

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

michaelchin commented 1 year ago

Do not upgrade cesium. The latest cesium does not work.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: yiyanw @.> Sent: Monday, October 17, 2022 5:46:49 PM To: GPlates/gplates-app @.> Cc: michaelchin @.>; Mention @.> Subject: Re: [GPlates/gplates-app] initialization problem (Issue #176)

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. @michaelchinhttps://github.com/michaelchin @matthew-merkashttps://github.com/matthew-merkas

— Reply to this email directly, view it on GitHubhttps://github.com/GPlates/gplates-app/issues/176#issuecomment-1280369706, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAUQKPC5RR5R62LMRCHDMVDWDTY5TANCNFSM6AAAAAARGIQTAI. You are receiving this because you were mentioned.Message ID: @.***>

yiyanw commented 1 year ago

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 commented 1 year ago

Use 1.95

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: yiyanw @.> Sent: Monday, October 17, 2022 5:56:27 PM To: GPlates/gplates-app @.> Cc: michaelchin @.>; Mention @.> Subject: Re: [GPlates/gplates-app] initialization problem (Issue #176)

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? @michaelchinhttps://github.com/michaelchin

— Reply to this email directly, view it on GitHubhttps://github.com/GPlates/gplates-app/issues/176#issuecomment-1280377114, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAUQKPF6NYIBAH635FFIXGTWDT2BXANCNFSM6AAAAAARGIQTAI. You are receiving this because you were mentioned.Message ID: @.***>

yiyanw commented 1 year ago

@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.