rogeriochaves / npm-force-resolutions

Force npm to install a specific transitive dependency version

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: ENOENT: no such file or directory, open './package-lock.json'

fredericrous opened this issue · comments

bur reproduction workflow:

  • remove package-lock.json in order to generate a clean one
  • run npm install
  • failure
    image

workaround:

npm i --ignore-scripts && npm i

tested on v 0.0.10

you can try

"preinstall": "npx npm-force-resolutions || echo 1",

as a workaround and I would work.

most likely a duplicate to #10

To anyone experiencing this issue, feel free to try: https://www.npmjs.com/package/force-resolutions

Just change:

"preinstall": "npx npm-force-resolutions"

To:

"preinstall": "npx force-resolutions"

npx force-resolutions does not run when no package-lock.json is detected, and allows the next command inline to be executed as normal. This is useful when installing dependencies for a package that has been already published where package-lock.json is not available.

Feedback and PR's are welcome