FredKSchott / snowpack

ESM-powered frontend build tool. Instant, lightweight, unbundled development. ✌️
https://www.snowpack.dev
MIT License
19.48k stars 922 forks source link

🐛 BUG: Snowpack can't find dependency `@npmcli/arborist`. #3594

Open flosker opened 3 years ago

flosker commented 3 years ago

Quick checklist

What package manager are you using?

pnpm, npm

What operating system are you using?

Linux

Describe the bug

Snowpack can't find dependency @npmcli/arborist.

Additional errors with NPM:

[11:21:00] [esinstall:@npmcli/arborist] /tmp/test/2/node_modules/@npmcli/arborist/lib/realpath.js
   Module "path" (Node.js built-in) is not available in the browser. Run Snowpack with --polyfill-node to fix.
[11:21:00] [esinstall:@npmcli/arborist] /tmp/test/2/node_modules/@npmcli/arborist/lib/realpath.js
   Module "util" (Node.js built-in) is not available in the browser. Run Snowpack with --polyfill-node to fix.
[11:21:00] [esinstall:@npmcli/arborist] /tmp/test/2/node_modules/@npmcli/arborist/lib/diff.js
   Module "fs" (Node.js built-in) is not available in the browser. Run Snowpack with --polyfill-node to fix.

Work perfectly with Snowpack version 3.7.1. But doesn't work on latest versions.

Steps to reproduce

  1. Create a new folder
  2. Do pnpm add snowpack. Or npm install snowpack
  3. Run npx snowpack dev
  4. Errors!

Link to minimal reproducible example (optional)

No response

flosker commented 3 years ago

Also happening to other users - https://github.com/snowpackjs/snowpack/issues/3158#issuecomment-879082772

Not specific to pnpm, happens with npm too.

EDIT: Latest npm works, only pnpm causes these errors.

talentlessguy commented 3 years ago

same

node 14.17.1, snowpack 3.3.7 and pnpm 6.11.5