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

Warning Message for Lifecycle Scripts Only Appears When Running deno task #27682

Open
quadratz opened this issue Jan 15, 2025 · 0 comments
Open

Comments

@quadratz
Copy link

When I ran deno install --allow-scripts, I didn't see any warning messages. However, when I ran deno task setup, which included the same script, I received a warning about npm lifecycle scripts not being executed.

Steps to Reproduce

  1. Create a deno.json file with the following content:
{
  "lock": false,
  "nodeModulesDir": "auto",
  "tasks": {
    "setup": "deno install --allow-scripts",
  },
  "imports": {
    "astro": "npm:[email protected]",
  }
}
  1. Run deno install --allow-scripts in terminal. (No warning appeared.)
  2. Delete the node_modules directory.
  3. Run deno task setup. (A warning appeared.)
qz@localhost:/tmp/astro-deno> deno task setup
Warning The following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed:
┠─ npm:[email protected]
┃
┠─ This may cause the packages to not work correctly.
┖─ To run lifecycle scripts, use the `--allow-scripts` flag with `deno install`:
   deno install --allow-scripts=npm:[email protected]
Task setup deno install --allow-scripts

Expected Behavior

I expected to see no warning for both deno install --allow-scripts and deno task setup, since the --allow-scripts flag was used.

Actual Behavior

No warning appeared during deno install, but a warning appeared during deno task setup.

Environment

Version: Deno 2.1.5 (stable, release, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2

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