Closed reggi closed 1 month ago
CC @devsnek looks similar to the previous require(esm)
panic.
@reggi FYI you can execute npm
fine in deno like so: deno run npm:npm
@bartlomieju I know 🤣, feel free to close
Yeah, it was probably fixed in https://github.com/denoland/deno_core/pull/910, just waiting on deno_core
upgrade here.
Same panic with deno run npm:npm
:
example deno run -A npm:npm install lodash
npm verbose cli npm /Users/reggi/example/node_modules/.deno/npm@10.8.3/node_modules/npm/bin/npm-cli.js
npm info using npm@10.8.3
npm info using node@v20.11.1
npm verbose node symlink /Users/reggi/.nvm/versions/node/v22.5.1/bin/npm
npm verbose title npm install lodash
npm verbose argv "install" "lodash"
npm verbose logfile logs-max:10 dir:/Users/reggi/.npm/_logs/2024-09-19T16_09_18_178Z-
npm verbose logfile /Users/reggi/.npm/_logs/2024-09-19T16_09_18_178Z-debug-0.log
============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.
Platform: macos aarch64
Version: 2.0.0-rc.3
Args: ["deno", "run", "-A", "npm:npm", "install", "lodash"]
thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.310.0/modules/map.rs:1223:24:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Note: people should use
deno add npm:lodash
Yes it should be fixed with a deno_core upgrade. The mystery to me is why something in npm would be hitting require(esm)
, which is still experimental in node.
@devsnek afaik we don't use require(esm)
i put together a check esm deps script https://gist.github.com/reggi/68be8cf9a80f1545e67d0fca0402d696
that will print out package deps with type module
and without exports["."].require
Dependency: chalk is ESM only Dependency: is-cidr is ESM only Dependency: supports-color is ESM only
which is why we import()
these ^^
I was curious if deno could run the npm cli. I changed the
cli/bin/npm-cli.js
file tocli/bin/npm-cli.cjs
and changed the shebang and I got a panic. Obviously this was just a goof, but just wanted to report the panic.