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

[BUG] Need to run npm install twice to fix npm ci command #7793

Closed
2 tasks done
Saibamen opened this issue Sep 25, 2024 · 1 comment
Closed
2 tasks done

[BUG] Need to run npm install twice to fix npm ci command #7793

Saibamen opened this issue Sep 25, 2024 · 1 comment
Labels
Bug thing that needs fixing Duplicate duplicate of another, existing issue

Comments

@Saibamen
Copy link

Saibamen commented Sep 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm error
npm error Invalid: lock file's yaml@1.10.2 does not satisfy yaml@2.5.1
npm error Missing: yaml@1.10.2 from lock file

Expected Behavior

npm ci should install packages without exception

Steps To Reproduce

Download repro repository: https://github.com/Saibamen/npm-double-install-bug

  1. Delete package-lock.json
  2. npm install
  3. npm ci

See errors

Building with commited lock file (created on Windows) and npm ci:

Check NPM

Building with fresh lock file, npm install and then npm ci

Check NPM with new lock file

Annoying workarounds

Workaround v1

Check NPM with workaround

  1. npm install
  2. Delete node_modules
  3. npm install
  4. npm ci

Workaround v2

Just run npm install twice, no need to delete node_modules.

Check NPM with workaround v2

  1. npm install
  2. npm install
  3. npm ci

Environment

  • npm: 10.8.3
  • Node.js: 20.17.0
  • OS Name: Windows 10
  • System Model Name: 10.0.19045.4894
  • npm config:
; node bin location = C:\Program Files\nodejs\node.exe
; node version = v20.17.0
; npm local prefix = C:\XXX\npm-double-install-bug
; npm version = 10.8.3
; cwd = C:\XXX\npm-double-install-bug
; HOME = C:\Users\YYY
; Run `npm config ls -l` to show all defaults.

Diff after running npm install second time:

diff --git a/package-lock.json b/package-lock.json
index 07842ff..4823f0c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1606,6 +1606,16 @@
         }
       }
     },
+    "node_modules/eslint-plugin-svelte/node_modules/yaml": {
+      "version": "1.10.2",
+      "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
+      "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
+      "dev": true,
+      "license": "ISC",
+      "engines": {
+        "node": ">= 6"
+      }
+    },
     "node_modules/eslint-scope": {
       "version": "7.2.2",
       "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
@@ -3528,21 +3538,6 @@
         }
       }
     },
-    "node_modules/svelte-check/node_modules/yaml": {
-      "version": "2.5.1",
-      "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz",
-      "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==",
-      "dev": true,
-      "license": "ISC",
-      "optional": true,
-      "peer": true,
-      "bin": {
-        "yaml": "bin.mjs"
-      },
-      "engines": {
-        "node": ">= 14"
-      }
-    },
     "node_modules/svelte-eslint-parser": {
       "version": "0.41.1",
       "resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-0.41.1.tgz",
@@ -3737,19 +3732,6 @@
         "url": "https://github.com/sponsors/antonk52"
       }
     },
-    "node_modules/tailwindcss/node_modules/yaml": {
-      "version": "2.5.1",
-      "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz",
-      "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==",
-      "dev": true,
-      "license": "ISC",
-      "bin": {
-        "yaml": "bin.mjs"
-      },
-      "engines": {
-        "node": ">= 14"
-      }
-    },
     "node_modules/text-table": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@@ -4067,13 +4049,16 @@
       "license": "ISC"
     },
     "node_modules/yaml": {
-      "version": "1.10.2",
-      "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
-      "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
+      "version": "2.5.1",
+      "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz",
+      "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==",
       "dev": true,
       "license": "ISC",
+      "bin": {
+        "yaml": "bin.mjs"
+      },
       "engines": {
-        "node": ">= 6"
+        "node": ">= 14"
       }
     },
     "node_modules/yocto-queue": {
@Saibamen Saibamen added Bug thing that needs fixing Needs Triage needs review for next steps labels Sep 25, 2024
@milaninfy
Copy link
Contributor

Closing: this looks to be similar if not a duplicate of an existing issue, #6787. If you believe your instance is unique, please provide further clarifying details.

@milaninfy milaninfy closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2024
@milaninfy milaninfy added Duplicate duplicate of another, existing issue and removed Needs Triage needs review for next steps labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Duplicate duplicate of another, existing issue
Projects
None yet
Development

No branches or pull requests

2 participants