How can I make package-lock, integrity SHAs, and locally built modules as tgz all work together?

Viewed 36

Consider the following scenario:

We have some modules that we install as tgz.

In package.json, they are referred to as:

"somePackage": "file:../modules/somePackage.tgz",

We'd like to use package-lock, and so we create package-lock files.

The package-lock file has:

 "node_modules/somePackage": {
      "version": "1.0.97",
      "resolved": "file:../modules/somePackage.tgz",
      "integrity": "sha512-PXp1Q75feN1P+PHhqZmPF/J/5q5oVnALOVtdDq69Bn29sqFdwHkNL1k4DjOBYbh1C8y8beETOc7T77hMUhrWmQ==",
      "dev": true,

The problem has to do with the integrity checksum. When rebuilding the package, and then running npm install, it fails integrity check.

I am not sure what the best way to go about this would be. Ultimately it would be nice to have a way to ignore checksum for tarballs like that, but I am not sure there is a way.

Currently using Npm 7 and Node 14.

0 Answers
Related