1
votes

The SHA512 integrity check is created upon npm install which is different in my local machine vs the same code in git CI. My local environment is windows 10 and in GIT CI I am using node:10-alpine docker image.

In Windows:

npm notice name:          chart-comp
npm notice version:       0.0.1
npm notice package size:  1.0 MB
npm notice unpacked size: 4.6 MB
npm notice shasum:        cbf5c63bc34ae8128528d0a2e5fa13b6790b8a40
npm notice integrity:     sha512-WLecytIRPiWKJ[...]MiP/bbOmmA7uQ==
npm notice total files:   3

In node:10-alpine

100 npm notice name:          chart-comp
101 npm notice version:       0.0.1                                   
102 npm notice package size:  1.0 MB                                  
103 npm notice unpacked size: 4.6 MB                                  
104 npm notice shasum:        01a64b8955ac1a0d05e8e13c0dee89987935079f
105 npm notice integrity:     sha512-01anWdE/r03VO[...]yD5hVsfmsQarQ==
106 npm notice total files:   3  

I tried the following 1. npm clear cache 2. delete the node_modules 3. deleting the cache in the windows folder

Really stuck on this and the only way i could think of is to git-ignore package-lock.json but thats a very bad idea.

1

1 Answers

0
votes

If I understand your issue correctly, it sounds like you're comparing npm install on Windows shell (i.e., either Command Prompt or PowerShell) to the same in your GIT bash, correct? If that's the case, then your GIT bash shell may well be compiling your node_modules in a MING-ified (i.e. quasi-Linux) way (which will vary depending on how you installed the GIT bash). And this could mean that you could have file-encoding differences between GIT and Windows 'bash' that cause SHA-hash differences. I have not tested this myself, as I don't use the Command Prompt or PowerShell shells for web-dev (for a variety of reasons), only the GIT bash (on Windows 10).

But I have also discovered that the Windows GIT version of node_modules can differ from what linux (Centos7) will build (i.e. using the same version of Node). The differences always show up in the .bin folders for various NPM packages.