rogeriochaves / npm-force-resolutions

Force npm to install a specific transitive dependency version
567 stars 28 forks source link

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

Open fredericrous opened 3 years ago

fredericrous commented 3 years ago

bur reproduction workflow:

workaround:

npm i --ignore-scripts && npm i

tested on v 0.0.10

edgar-arroyo-by commented 3 years ago

you can try

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

as a workaround and I would work.

mfranzke commented 3 years ago

most likely a duplicate to #10

angelogiuseppe commented 3 years ago

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