3

I needed to fix security vulnerabilities for knexnest > knex > minimist. The version for minimist did not get updated with npm audit fix or simple npm update. I followed this article and it updated the versions and gave a vulnerability score of 0. But now when I create a docker image (build) my repo, it fails at the preinstall script.

npx: installed 5 in 5.29s
EACCES: permission denied, open './package-lock.json'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-service@1.2.3 preinstall: `npx npm-force-resolutions`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the my-service@1.2.3 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/node/.npm/_logs/2020-07-15T09_56_56_625Z-debug.log

While installing modules locally on editor, no errors pop up. Please help!

Harshita
  • 382
  • 1
  • 6
  • 21

1 Answers1

1

I had the same error, I fixed it with

chmod 666 package-lock.json

This doesn't seem as a root cause solution, but it's a simple workaround.

D M
  • 5,769
  • 4
  • 12
  • 27
maxov
  • 26
  • 2