1

I´ve a NextJs & ReactJs application built up with these libs:

    "next": "^13.3.1",
    "next-auth": "^4.20.1",
    "next-http-proxy-middleware": "^1.2.5",
    "next-pwa": "^5.6.0",

Let´s assume all dependencies listed in the project package.json are all installed with npm install and package-lock.json is updated. And package.json and package-lock.json are part of the project repository.

Once I run the NextJs application with the command npx next dev what happens is that at the end of package-lock.json these extra node module configuration are added.

    "node_modules/@next/swc-darwin-x64": { ... }
    "node_modules/@next/swc-linux-arm64-gnu": { ... }
    "node_modules/@next/swc-linux-arm64-musl": { ... }
    "node_modules/@next/swc-linux-x64-gnu": { ... }
    "node_modules/@next/swc-linux-x64-musl": { ... }
    "node_modules/@next/swc-win32-arm64-msvc": { ... }
    "node_modules/@next/swc-win32-ia32-msvc": { ... }
    "node_modules/@next/swc-win32-x64-msvc": {
      "version": "13.3.1",
      "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.3.1.tgz",
      "integrity": "sha512-Sl1F4Vp5Z1rNXWZYqJwMuWRRol4bqOB6+/d7KqkgQ4AcafKPN1PZmpkCoxv4UFHtFNIB7EotnuIhtXu3zScicQ==",
      "cpu": [
        "x64"
      ],
      "optional": true,
      "os": [
        "win32"
      ],
      "engines": {
        "node": ">= 10"
      }
    }

I just copied fully, the last object for readability, but all these objects are more or less similar.

My question is, why is this happening, and shall I update and push to repo also this updated version of package-lock.json?

Thanks

axel
  • 3,778
  • 4
  • 45
  • 72

0 Answers0