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

--force flag is required to run npm install in this repository #15429

Closed
srmagura opened this issue Sep 13, 2022 · 6 comments · Fixed by #16327
Closed

--force flag is required to run npm install in this repository #15429

srmagura opened this issue Sep 13, 2022 · 6 comments · Fixed by #16327
Labels

Comments

@srmagura
Copy link
Contributor

First reported here.

Repro steps:

~/Downloads node --version
v16.15.0
~/Downloads npm --version
8.19.1
~/Downloads git clone https://github.com/mozilla/pdf.js.git
Cloning into 'pdf.js'...
remote: Enumerating objects: 84802, done.
remote: Counting objects: 100% (113/113), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 84802 (delta 64), reused 74 (delta 46), pack-reused 84689
Receiving objects: 100% (84802/84802), 132.86 MiB | 21.02 MiB/s, done.
Resolving deltas: 100% (60426/60426), done.
~/Downloads cd pdf.js 
~/Downloads/pdf.js (master| ✔) npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint-plugin-html
npm ERR!   dev eslint-plugin-html@"^7.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-html@"^6.0.0" from [email protected]
npm ERR! node_modules/eslint-plugin-mozilla
npm ERR!   dev eslint-plugin-mozilla@"^2.12.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint-plugin-html
npm ERR!   peer eslint-plugin-html@"^6.0.0" from [email protected]
npm ERR!   node_modules/eslint-plugin-mozilla
npm ERR!     dev eslint-plugin-mozilla@"^2.12.4" 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/srmagura/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/srmagura/.npm/_logs/2022-09-13T01_27_30_763Z-debug-0.log
@hrittik2002
Copy link

hello,
You can run this command in the pdf.js directory before npm i
npm uninstall [email protected]
and then run npm i

@xwk
Copy link

xwk commented Sep 15, 2022

I encoutered same problem as described by @srmagura. Then I tried what @hrittik2002 said, but the "npm uninstall [email protected]" command failed with almost the same error as "npm install"

(master)npm uninstall [email protected]
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint-plugin-html
npm ERR!   dev eslint-plugin-html@"^7.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-html@"^6.0.0" from [email protected]
npm ERR! node_modules/eslint-plugin-mozilla
npm ERR!   dev eslint-plugin-mozilla@"^2.12.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint-plugin-html
npm ERR!   peer eslint-plugin-html@"^6.0.0" from [email protected]
npm ERR!   node_modules/eslint-plugin-mozilla
npm ERR!     dev eslint-plugin-mozilla@"^2.12.4" 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/victor/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/victor/.npm/_logs/2022-09-15T10_58_33_252Z-debug-0.log

@simulatune
Copy link

Change node.js version to 14 worked.

@skieffer
Copy link

skieffer commented Oct 5, 2022

Problem seems to be that even the latest eslint-plugin-mozilla (v 2.12.5) requires earlier versions of some other packages.

Chain reaction is:

  • [email protected] implies
    • eslint-plugin-html < 7.0.0
    • eslint-plugin-prettier < 4.0.0 implies
      • prettier < 2.0.0 implies
        • stylelint-prettier < 2.0.0

So I tried the following changes:

$ git diff package.json
diff --git a/package.json b/package.json
index 254e663a5..e3de9a2da 100644
--- a/package.json
+++ b/package.json
@@ -18,12 +18,12 @@
     "eslint": "^8.24.0",
     "eslint-config-prettier": "^8.5.0",
     "eslint-plugin-fetch-options": "^0.0.5",
-    "eslint-plugin-html": "^7.1.0",
+    "eslint-plugin-html": "^6.0.0",
     "eslint-plugin-import": "^2.26.0",
     "eslint-plugin-json": "^3.1.0",
     "eslint-plugin-mozilla": "^2.12.5",
     "eslint-plugin-no-unsanitized": "^4.0.1",
-    "eslint-plugin-prettier": "^4.2.1",
+    "eslint-plugin-prettier": "^3.0.0",
     "eslint-plugin-sort-exports": "^0.7.0",
     "eslint-plugin-unicorn": "^44.0.0",
     "fit-curve": "^0.2.0",
@@ -42,13 +42,13 @@
     "postcss": "^8.4.17",
     "postcss-dir-pseudo-class": "^6.0.5",
     "postcss-logical": "^5.0.4",
-    "prettier": "^2.7.1",
+    "prettier": "^1.0.0",
     "puppeteer": "^18.0.5",
     "rimraf": "^3.0.2",
     "streamqueue": "^1.1.2",
     "stylelint": "^14.13.0",
     "stylelint-config-prettier": "^9.0.3",
-    "stylelint-prettier": "^2.0.0",
+    "stylelint-prettier": "^1.0.0",
     "systemjs": "^0.21.6",
     "systemjs-plugin-babel": "^0.0.25",
     "terser": "^5.15.0",

and this allowed npm install to work.

After this, I did not try running many tests, but can say that gulp generic at least succeeded.

@Snuffleupagus
Copy link
Collaborator

Chain reaction is:

This part was fixed in bug 1792465, and thus ought to be resolved whenever the eslint-plugin-mozilla package is next updated.

  • eslint-plugin-prettier < 4.0.0 implies
    • prettier < 2.0.0 implies
      • stylelint-prettier < 2.0.0

This part appears to be blocked on bug 1749499 being fixed.

So I tried the following changes:

Unfortunately we won't consider downgrading these NPM packages, given that the older Prettier versions have worse formatting and that a work-around exists (i.e. installing with npm install -f instead).


Closing this issue (and pinning it for visibility), since the remaining issues can't/won't be fixed here.

@cgsthtm
Copy link

cgsthtm commented Mar 22, 2023

Chain reaction is:

This part was fixed in bug 1792465, and thus ought to be resolved whenever the eslint-plugin-mozilla package is next updated.

  • eslint-plugin-prettier < 4.0.0 implies

    • prettier < 2.0.0 implies

      • stylelint-prettier < 2.0.0

This part appears to be blocked on bug 1749499 being fixed.

So I tried the following changes:

Unfortunately we won't consider downgrading these NPM packages, given that the older Prettier versions have worse formatting and that a work-around exists (i.e. installing with npm install -f instead).

Closing this issue (and pinning it for visibility), since the remaining issues can't/won't be fixed here.

Please give me a direction, which node version, npm version and gulp version should i use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
8 participants