Turn off integrity verification for local dependencies in package-lock.json

Is there a way to bypass the integrity check for a local dependency in package-lock.json?

Within my project repository, I have a core library along with two Angular applications that both rely on this core library as a dependency.

The problem arises because the integrity sha512 of the core library changes with each build, causing npm to fail when attempting to install dependencies.

This is the error message it displays:

npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting @me/base-library@file:../lib/me-base-library-1.0.0.tgz:
npm ERR! Verification failed while extracting @me/base-library@file:../lib/me-base-library-1.0.0.tgz:
npm ERR! Integrity check failed:
npm ERR!   Wanted: sha512-(...)
npm ERR!    Found: sha512-(...)

Here is an excerpt from "package-lock.json":

"@me/base-library": {
  "version": "file:../lib/me-base-library-1.0.0.tgz",
  "integrity": "sha512-(...)" // <- different with every build
}

Does anyone know of a way to disable integrity checks for local dependencies?

Answer №1

I am uncertain if such an option exists - it would essentially be a switch to address security concerns.

To resolve this issue without compromising security, you can reinstall the package, which will automatically update the integrity value:

npm install file:../lib/me-base-library-1.0.0.tgz

To streamline this process, consider setting up an npm script:

{
  "scripts": {
    "update-base": "npm install file:../lib/me-base-library-1.0.0.tgz"
  }
}
npm run update-base

Answer №2

To resolve the issue, I made a simple adjustment by referencing the directory of my library instead of the TGZ file. It turns out that npm and yarn (both tested) do not generate integrity hashes for folders, only for files. So in my Angular app's package.json files, I updated from

"@me/base-library": "file:../lib/me-base-library-1.0.0.tgz"
to
"@me/base-library": "file:../lib"
.

Furthermore, I had to include additional properties in the base library's package.json file:

  "main": "lib/bundles/me-base-library.umd.js",
  "module": "lib/fesm2015/me-base-library.js",
  "es2015": "lib/fesm2015/me-base-library.js",
  "esm2015": "lib/esm2015/me-base-library.js",
  "fesm2015": "lib/fesm2015/me-base-library.js",
  "typings": "lib/me-base-library.d.ts"

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Disable Button's Shadow when it is in an active state (clicked)

Check out the DEMO to see the button animation CSS in action. The CSS code for the button animations is as follows: .btnliner { /* CSS properties */ } /* More CSS properties */ .btnliner:hover { /* Hover effects */ } Here is the corresponding J ...

Infinite loop triggered by jQuery dropdown menu on page resize was causing an issue

I have been working on developing a navigation menu for a website that displays as a horizontal bar on larger screens, but transforms into a jQuery dropdown menu when the window width is less than 980px. During initial page load with a window width below ...

Which one should you begin with: AngularJS or Angular 2?

Interested in learning Angular and curious about the differences between Angular, AngularJS, and Angular 2. Should I focus on educating myself on Angular or go straight to Angular 2, considering it's now in beta version? Is there a significant differ ...

Every time I try to upload image files to cloudinary, I encounter this frustrating error message

https://i.stack.imgur.com/kRYVZ.png The issue at hand revolves around node and the challenge of using the https module with new certificates, proving to be unsuccessful... The proposed solution is ambiguous, leaving me unsure how to proceed and resolve thi ...

Starting PM2 with multiple instances can be achieved by following these steps

While running my nodejs code with PM2, I encountered a requirement for multiple instances of nodejs executing the same code. To address this need, I created a script named "myscript.sh": cd ~/myproject PM2_HOME='.pm2_1' /usr/local/bin/node /u ...

What is the process for changing CORS origins while the NodeJS server is active?

Currently, I am in the process of modifying the CORS origins while the NodeJS server is operational. My main goal is to replace the existing CORS configuration when a specific user action triggers an update. In my attempt to achieve this, I experimented w ...

The functionality of the custom file upload button is experiencing issues on Microsoft Edge

I've been working on creating a unique custom image upload button that functions perfectly in Chrome, Firefox, and Opera based on my testing. However, I'm facing an issue where it doesn't work properly in Microsoft Edge. Feel free to check ...

Learn the process of transferring information from a dynamically generated table to a database using PHP

After creating a table using PHP dynamically, I am facing an issue with updating some cell values based on user input. I have provided my code below. I tried using [] in the names attribute to make names an array as suggested on Stack Overflow, but it didn ...

The HTML document is having trouble establishing a connection with socketio

I currently hold an HTML file within my local file system, presented as follows: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Example of a Minimal Working File</title> ...

Sometimes, Express may return the message "not found" on and off

After working with express for many years, I find myself a bit out of practice with TypeScript - and it seems like my eyesight is failing me! This is the first time I've encountered this issue, so I must be missing something... My current dilemma is ...

retrieving a property from an ElementHandle

I'm working with Puppeteer within a Node.js module and I need to extract the text property of an HTML element selected by its XPath. Is there a more concise way to achieve this? // Retrieve the element let element = await page.$x(`xpath_expre ...

Is it conceivable that Jquery is failing to load for an Ajax request?

I have been experiencing an issue with my jQuery code not working within Ajax requests. The jQuery plugin I am using is FancyBox which can be found at . When calling the FancyBox plugin directly, everything works perfectly and multiple links load the plugi ...

Is there a way to adjust the StatusBar color or make it transparent on Android when working with NativeScript and Angular?

I am having trouble changing the StatusBar color in my NativeScript with Angular project. It currently appears as translucent black, darkening the background behind it. I want to either make it transparent or match the background color of the page. What I ...

Unique styling implementation for element situated underneath Angular 6 router-outlet

I'm currently working on implementing router transitions in my Angular application, and I've encountered an unusual problem. The styling for the router-outlet element is being applied to the element that comes after it in the DOM hierarchy. Here ...

Difficulty encountered while attempting to deploy the front-end on Heroku

I recently completed a typeorm project with the following structure: https://i.stack.imgur.com/ReQK1.png Both the client and root directories contain index files located in the src directory. In the package.json file within the client directory, I made a ...

What is the best way to sort through an array depending on a specific sequence of elements provided

I am trying to create a custom pipe in Angular 5 that filters an array of events based on a given sequence. For instance, if my data is: ["submit", "click", "go_back", "click",...] I want to filter this data based on up to three inputs. If input ...

The inner joins in my SQL query are causing me to receive duplicate results

I am trying to retrieve the posts made by users followed by the userID (? in the query), as well as the posts by the user themselves. SELECT posts.id AS postid, posts.user AS user, posts.images AS images, posts.post_created, posts.textvalue, posts.te ...

Google oauth20 passport is ready to go, just gotta activate passport.initialize() - no middleware needed!

Currently, I am utilizing passport-google-oauth20, mongoose, mlab for user authentication. Upon receiving the callback from google auth, I encounter the following error within the done method: UnhandledPromiseRejectionWarning: Unhandled promise rejection ...

Is it possible to generate two output JSON Objects for a JavaScript line chart?

How can I display two lines in a Chart.js line chart using data from a JSON file with 2 objects stored in the database? When attempting to show both sets of data simultaneously, I encountered an issue where the output was always undefined. Why is this hap ...

Making calls to an Angular GRPC API through an Envoy proxy

Having trouble connecting to the GRPC server from the UI via Envoy. Here's the code snippet for the Envoy proxy: static_resources: listeners: - address: socket_address: address: 0.0.0.0 port_value: 8888 filter_chains: ...