My npm install on jenkins installs a version of a package other than defined in the package-lock.json.
When I run it locally (on a windows), it works as expected, 1.4.10 of cleave.js package is installed. Though, when I run it through jenkins, it installs a different version, 1.5.3.
When I checked the jenkins build logs, it looks like it installs the package from a cached binary.
Cached binary found at /var/lib/jenkins/.npm/node-sass/4.12.0/linux-x64-57_binding.node
> core-js@2.6.9 postinstall /var/lib/jenkins/workspace/CI-MyProject-Demo/build/exports/MyProject/MyProject-web/node_modules/core-js
> node scripts/postinstall || echo "ignore"
> sauce-connect-launcher@1.2.7 postinstall /var/lib/jenkins/workspace/CI-MyProject-Demo/build/exports/MyProject/MyProject-web/node_modules/sauce-connect-launcher
> node scripts/install.js || nodejs scripts/install.js
> node-sass@4.12.0 postinstall /var/lib/jenkins/workspace/CI-MyProject-Demo/build/exports/MyProject/MyProject-web/node_modules/node-sass
> node scripts/build.js
Binary found at /var/lib/jenkins/workspace/CI-MyProject-Demo/build/exports/MyProject/MyProject-web/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
sfra@4.0.0 /var/lib/jenkins/workspace/CI-MyProject-Demo/build/exports/MyProject/MyProject-web
...
│ └── rimraf@2.7.1
├── cleave.js@1.5.3
├─┬ cross-env@5.2.1
...
Now, the possible solution I can think of is that I can delete /var/lib/jenkins/.npm/node-sass/4.12.0/linux-x64-57_binding.node
this file, and it should probably work. But I'm not sure if that would break anything else, or if that's the way to go.
Any help is appreciated.