Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fredericrous opened this issue May 10, 2021 · 3 comments
Open

Comments

@fredericrous
Copy link

fredericrous commented May 10, 2021

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

@edgar-arroyo-by
Copy link

you can try

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

as a workaround and I would work.

@mfranzke
Copy link

most likely a duplicate to #10

@angelogiuseppe
Copy link

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

klassm added a commit to klassm/eslint-plugin-testcafe-community that referenced this issue Oct 28, 2021
The underlying issue is rogeriochaves/npm-force-resolutions#36. The accepted answer is to change npm-force-resolutions to force-resolutions, as this will not run when a package-lock.json is not present, covering the scenario when you install a package (like we do)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants