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

Preinstall crashes with file not found and package-lock.json #28

Closed
klassm opened this issue Oct 28, 2021 · 4 comments · Fixed by #30
Closed

Preinstall crashes with file not found and package-lock.json #28

klassm opened this issue Oct 28, 2021 · 4 comments · Fixed by #30
Assignees
Labels
bug Something isn't working released

Comments

@klassm
Copy link
Contributor

klassm commented Oct 28, 2021

Hi,

we are happily using the eslint-plugin-testcafe-community. Since the last version (1.2.6) it crashes during npm install with the following error:

> eslint-plugin-testcafe-community@1.2.6 preinstall /Users/_my_user/IdeaProjects/bla/node_modules/eslint-plugin-testcafe-community
> npx npm-force-resolutions

npx: installed 6 in 1.359s
Error: ENOENT: no such file or directory, open './package-lock.json'
    at Object.openSync (fs.js:461:3)
    at Object.fs [as readFileSync] (fs.js:364:35)
    at npm_force_resolutions$core$node_slurp (/Users/_my_user/.npm/_npx/94072/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:15:20)
    at npm_force_resolutions$core$read_json (/Users/_my_user/.npm/_npx/94072/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:22:23)
    at switch__2144__auto__ (/Users/_my_user/.npm/_npx/94072/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:151:3)
    at /Users/_my_user/.npm/_npx/94072/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:151:3
    at npm_force_resolutions$core$update_package_lock_$_state_machine__2145__auto____1 (/Users/_my_user/.npm/_npx/94072/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.js:648:4)
    at cljs.core.async.impl.ioc-helpers/FN-IDX (/Users/_my_user/.npm/_npx/94072/lib/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.js:664:88)
    at cljs.core.async.impl.ioc-helpers/run-state-machine (/Users/_my_user/.npm/_npx/94072/lib/node_modules/npm-force-resolutions/out/cljs/core/async/impl/ioc_helpers.cljs:35:23)
    at cljs$core$async$impl$ioc_helpers$run_state_machine_wrapped (/Users/_my_user/.npm/_npx/94072/lib/node_modules/npm-force-resolutions/out/cljs/core/async/impl/ioc_helpers.cljs:39:6)

Do you have any advice on how to solve this issue? The npm-force-resolutions seems to have been introduced in the most recent version.

Thank you so much!
Matthias

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)
@codejedi365 codejedi365 self-assigned this Oct 28, 2021
@codejedi365 codejedi365 added the bug Something isn't working label Oct 28, 2021
@codejedi365 codejedi365 linked a pull request Oct 28, 2021 that will close this issue
codejedi365 added a commit that referenced this issue Oct 28, 2021
fix: repair force resolutions, closes #28
@github-actions
Copy link

🎉 This issue has been resolved in version 1.2.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@codejedi365
Copy link
Collaborator

@klassm, thank you for the PR and bringing this issue to my attention. Personally was trying to limit the annoying vulnerability alerts from dev dependencies so I know when there is one for a production dependency. I did not expect an issue in the production build but I'm glad you found a resolution so quick. Thank you.

@klassm
Copy link
Contributor Author

klassm commented Oct 28, 2021

Sure, we are using the plugin. So we can also at least try to help you maintain it.
Enjoy your evening 🙂
Matthias

@codejedi365
Copy link
Collaborator

@klassm, I love the attitude, it is how I feel as well!

I'm glad we created this issue and pushed a fix so that this package does not fail on installation. However, I did just come across that the force-resolutions package does not work as intended so we have a half-fix. I just opened this issue on their repository angelogiuseppe/force-resolutions#1.

Basically, I'm back to where we were before v1.2.6. I wish remark-parse would just update their dependencies but they refuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants