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

Possible dependency conflict #412

Open
Ronkiro opened this issue Oct 17, 2022 · 4 comments · May be fixed by #414
Open

Possible dependency conflict #412

Ronkiro opened this issue Oct 17, 2022 · 4 comments · May be fixed by #414
Assignees

Comments

@Ronkiro
Copy link
Contributor

Ronkiro commented Oct 17, 2022

-- Bug Report --

Expected Behavior

npm install or make setup should execute successfully without flags

Current Behavior

It returns this in stderr:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^6.8.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">=4 <6.0.0" from [email protected]
npm ERR! node_modules/eslint-watch
npm ERR!   dev eslint-watch@"^5.1.2" from the root project
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.

Steps to Reproduce

  1. Clone repo
  2. Execute make setup (or npm install).

Not sure if this occurs in any environments, seems to run ok in my docker.

Using w10 enterprise, node v14.16.0 managed by nvm (https://github.com/coreybutler/nvm-windows)

@rodrigondec
Copy link

rodrigondec commented Oct 21, 2022

Reproduced on my environment

megadraft [ master][📦 v0.7.5][ v18.9.1][☁️  (use-east-1)]
❯ make setup
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^6.8.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">=4 <6.0.0" from [email protected]
npm ERR! node_modules/eslint-watch
npm ERR!   dev eslint-watch@"^5.1.2" from the root project
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! 
npm ERR! See /home/rodrigondec/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rodrigondec/.npm/_logs/2022-10-21T00_30_34_814Z-debug-0.log
make: *** [Makefile:8: setup] Error 1

I will work on this 😁

@rodrigondec
Copy link

rodrigondec commented Oct 21, 2022

I managed to parse the yarn.lock to package-lock.json. With this. the first npm i works. Doing another npm i break the dependencies (probably on the first some packages are updated).

It is not recommended to support YARN and NPM as package managers/runners. It can cause dependencies conflict.

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
image

What can I do?

Can I migrate all commands do YARN and drop NPM support? This could resolve the problem.

the makefile indicates support to BOTH tools. But npm is used on the project commands within package.json, such as buld with "build": "npm run build:lib && gulp sass && gulp sass-copy"

Can I change package versions to resolve the conflict? Some packages could be downgraded while others updated.

Running problem

I tried running both with yarn and npm on the build command.

The following error occur

[09:29:29] 'devServer' errored after 682 ms
[09:29:29] Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/media/dados/prog/hacktober/megadraft/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/media/dados/prog/hacktober/megadraft/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/media/dados/prog/hacktober/megadraft/node_modules/webpack/lib/NormalModule.js:471:10)
    at /media/dados/prog/hacktober/megadraft/node_modules/webpack/lib/NormalModule.js:503:5
    at /media/dados/prog/hacktober/megadraft/node_modules/webpack/lib/NormalModule.js:358:12
    at /media/dados/prog/hacktober/megadraft/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/media/dados/prog/hacktober/megadraft/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/media/dados/prog/hacktober/megadraft/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/media/dados/prog/hacktober/megadraft/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /media/dados/prog/hacktober/megadraft/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /media/dados/prog/hacktober/megadraft/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
    at FSReqCallback.callbackTrampoline (node:internal/async_hooks:130:17)
[09:29:29] 'dev-server' errored after 686 ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make: *** [Makefile:11: run] Error 1

Is this related? Or it's another problem to tackle?

@Ronkiro
Copy link
Contributor Author

Ronkiro commented Oct 21, 2022

@rodrigondec seems not related. I agree that supporting only one package manager is better in this sense. But the conflict of this issue was probably caused due to some kind of update to eslint or something like that. Probably updating eslint-watch (the package that asks for a different version of eslint) to some version that supports eslint 6.8.0 may help solving the issue. If not possible, the solution probably will need to change the package or downgrade eslint (and other packages that need 6.8.0)

@rodrigondec
Copy link

rodrigondec commented Oct 21, 2022

I asked about only one package manager because yarn is better than npm at solving dependency conflicts. As it is, it's possible to do make setup with yarn without the manifestation of the conflict.

what is a error on npm is a warning on yarn

yarn install v1.22.19
warning ../package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "eslint@>=4 <6.0.0".
warning " > [email protected]" has unmet peer dependency "estraverse@*".
warning " > [email protected]" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
warning " > [email protected]" has incorrect peer dependency "react@^16.0.0-0 < 16.4.0".
warning " > [email protected]" has incorrect peer dependency "react-dom@^16.0.0-0 < 16.4.0".
warning " > [email protected]" has incorrect peer dependency "react@^16.14.0".
[4/4] Building fresh packages...
$ yarn run build
yarn run v1.22.19
warning ../package.json: No license field
$ yarn run build:lib && gulp sass && gulp sass-copy
warning ../package.json: No license field
$ babel src/ -d lib/

So I shall drop npm support as it can be agreed upon

I agree that supporting only one package manager is better in this sense.

Additionally, should resolve dependencies to avoid the yarn warning?

Or the show can go on? 🤣

@rodrigondec rodrigondec linked a pull request Oct 21, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants