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

Unused "precommit" script in this repo blocking deno from using centralized node_modules folder #13271

Open
ZYinMD opened this issue Jan 4, 2025 · 0 comments

Comments

@ZYinMD
Copy link

ZYinMD commented Jan 4, 2025

Describe the bug

There's a "precommit" script in the package.json file in this repo:

"precommit": "pnpm format && pnpm lint",

I suspect this line ↑ isn't being used. I looked through this repo and don't see any signs of it being used. Maybe it's a relic of the past?

Why it's a problem:
I'm trying to use deno as package manager for my sveltekit2 project, and deno allows using a central location for all node_modules instead of local node_modules in each project. I don't know if that's possible with sveltekit2, but I wanted to try. I did expect hurdles, but the first hurdle I encountered was this:

deno task dev

Warning: 
The following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed:
┠─ npm:@sveltejs/[email protected]
┃
┠─ This may cause the packages to not work correctly.
┠─ Lifecycle scripts are only supported when using a `node_modules` directory.
┠─ Enable it in your deno config file:
┖─ "nodeModulesDir": "auto"
Task dev vite dev

So, if the "precommit" isn't being used, can we remove it?

Reproduction

  1. npx sv create test-app
  2. choose deno as package manager when asked
  3. create deno.json inside project, with content { "nodeModulesDir": "none" } doc here
  4. run deno task dev to start dev server

Logs

See above

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 7 8845HS w/ Radeon 780M Graphics
    Memory: 26.80 GB / 60.81 GB
  Binaries:
    Node: 20.17.0 - ~\AppData\Local\pnpm\node.EXE
    npm: 10.8.2 - ~\AppData\Local\pnpm\npm.CMD
    pnpm: 9.13.2 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (128.0.2739.42)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @sveltejs/adapter-auto: ^3.0.0 => 3.3.1
    @sveltejs/kit: ^2.0.0 => 2.15.1
    @sveltejs/vite-plugin-svelte: ^4.0.0 => 4.0.4
    svelte: ^5.0.0 => 5.16.1
    vite: ^5.4.11 => 5.4.11

Severity

annoyance

Additional Information

No response

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

1 participant