Skip to content

npm ls -a reports unmet dependency errors on WASM package when installing @tailwindcss/postcss #19136

Description

@foobar-star

Possible Bug Report

What version of Tailwind CSS are you using? @tailwindcss/postcss@4.1.14 and tailwindcss@4.1.14

What build tool (or framework if it abstracts the build tool) are you using? npx create-next-app@latest or node.js

What version of Node.js are you using? v24.10.0 and v22.10.0

What browser are you using? N/A

What operating system are you using? Linux

Reproduction URL

Installing Tailwind CSS v4 in next.js projects or just plain node.js (specifically @tailwindcss/postcss@4.1.14) introduces either extraneous WebAssembly dependencies such as @emnapi/runtime(if using npm 11 and node version 22) or ESLProblems If using npm 11+ and node 24. In the former issue(node v 22) extraneous dependencies cannot be removed by standard methods (npm uninstall, npm prune, --ignore-scripts, etc.) and persist after installation and get reinstalled by post install scripts from napi-postinstall causing confusion and potentially interfering with clean environments or minimal builds.

Keep in mind these steps have only been identified when the sharp package is present either as a direct or as a transitive dependency. Sharp is a transitive dependency by default in all next.js projects.

You can reproduce these issues here: https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template?file=%2F.gitignore

This issue originally was brought up here: vercel/next.js#84450 and lovell/sharp#4464 was thought to be caused by create-next-app, and the sharp packages Emscripten detection which uses similar WebAssembly binaries as tailwind and rebuilds them post-install lovell/sharp#4442.

The two specific packages thought to explain the issue now are eslint-config-next@15.5.4 and @tailwindcss/postcss@4.1.14 by the way of tailwindcss/oxide-wasm32-wasi, unrs-resolver (optional dependency of eslint-config-next.js). See full explanation here: vercel/next.js#84450 (comment)

Here are the exact steps to reproduce the issues using node version 22.10.0

To Reproduce

$ node -v
v22.10.0
$ npm -v
11.6.1

$ npx create-next-app@latest my-app -ts -tw -eslint
if flags are not working please select typescript, tailwind, and eslint


$ npm ls
my-app@0.1.0 /project/workspace/my-app
├── @emnapi/core@1.5.0 extraneous
├── @emnapi/runtime@1.5.0 extraneous
├── @emnapi/wasi-threads@1.1.0 extraneous
├── @eslint/eslintrc@3.3.1
├── @napi-rs/wasm-runtime@0.2.12 extraneous
├── @tailwindcss/postcss@4.1.14
├── @tybys/wasm-util@0.10.1 extraneous
├── @types/node@20.19.21
├── @types/react-dom@19.2.2
├── @types/react@19.2.2
├── eslint-config-next@15.5.5
├── eslint@9.37.0
├── next@15.5.5
├── react-dom@19.1.0
├── react@19.1.0
├── tailwindcss@4.1.14
└── typescript@5.9.3

Traditional cleanup commands have no effect so running npm uninstall emnapi/runtime@1.5.0 or other cleanup commands (npm prune, reinstalling, clearing caches, ignore scripts) does not remove it or Post Install scripts from optional dependencies make these persist. vercel/next.js#84450 (comment)

OR with node 24+ and NPM 11+ and installing @tailwindcss/postcss as per lovell lovell/sharp#4464 (comment)

$ node -v
v24.10.0

$ npm -v
11.6.1

$ cat package.json 
{
  "dependencies": {
    "@tailwindcss/postcss": "^4.1.14",
    "sharp": "^0.34.4"
  }
}

$ npm install

added 76 packages, and audited 77 packages in 2s

38 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

$ npm ls
├── @tailwindcss/postcss@4.1.14
└── sharp@0.34.4

$ ls -w1 node_modules/@img
colour
sharp-libvips-linux-x64
sharp-linux-x64

$ npm ls --all
├─┬ @tailwindcss/postcss@4.1.14
│ ├── @alloc/quick-lru@5.2.0
│ ├─┬ @tailwindcss/node@4.1.14
│ │ ├─┬ @jridgewell/remapping@2.3.5
│ │ │ ├─┬ @jridgewell/gen-mapping@0.3.13
│ │ │ │ ├── @jridgewell/sourcemap-codec@1.5.5 deduped
│ │ │ │ └── @jridgewell/trace-mapping@0.3.31 deduped
│ │ │ └─┬ @jridgewell/trace-mapping@0.3.31
│ │ │   ├── @jridgewell/resolve-uri@3.1.2
│ │ │   └── @jridgewell/sourcemap-codec@1.5.5 deduped
│ │ ├─┬ enhanced-resolve@5.18.3
│ │ │ ├── graceful-fs@4.2.11
│ │ │ └── tapable@2.3.0
│ │ ├── jiti@2.6.1
│ │ ├─┬ lightningcss@1.30.1
│ │ │ ├── detect-libc@2.1.2 deduped
│ │ │ ├── lightningcss-darwin-arm64@1.30.1
│ │ │ ├── lightningcss-darwin-x64@1.30.1
│ │ │ ├── lightningcss-freebsd-x64@1.30.1
│ │ │ ├── lightningcss-linux-arm-gnueabihf@1.30.1
│ │ │ ├── lightningcss-linux-arm64-gnu@1.30.1
│ │ │ ├── lightningcss-linux-arm64-musl@1.30.1
│ │ │ ├── lightningcss-linux-x64-gnu@1.30.1
│ │ │ ├── lightningcss-linux-x64-musl@1.30.1
│ │ │ ├── lightningcss-win32-arm64-msvc@1.30.1
│ │ │ └── lightningcss-win32-x64-msvc@1.30.1
│ │ ├─┬ magic-string@0.30.19
│ │ │ └── @jridgewell/sourcemap-codec@1.5.5
│ │ ├── source-map-js@1.2.1
│ │ └── tailwindcss@4.1.14 deduped
│ ├─┬ @tailwindcss/oxide@4.1.14
│ │ ├── @tailwindcss/oxide-android-arm64@4.1.14
│ │ ├── @tailwindcss/oxide-darwin-arm64@4.1.14
│ │ ├── @tailwindcss/oxide-darwin-x64@4.1.14
│ │ ├── @tailwindcss/oxide-freebsd-x64@4.1.14
│ │ ├── @tailwindcss/oxide-linux-arm-gnueabihf@4.1.14
│ │ ├── @tailwindcss/oxide-linux-arm64-gnu@4.1.14
│ │ ├── @tailwindcss/oxide-linux-arm64-musl@4.1.14
│ │ ├── @tailwindcss/oxide-linux-x64-gnu@4.1.14
│ │ ├── @tailwindcss/oxide-linux-x64-musl@4.1.14
│ │ ├─┬ @tailwindcss/oxide-wasm32-wasi@4.1.14
│ │ │ ├── UNMET DEPENDENCY @emnapi/core@^1.5.0
│ │ │ ├── @emnapi/runtime@1.5.0 deduped
│ │ │ ├── UNMET DEPENDENCY @emnapi/wasi-threads@^1.1.0
│ │ │ ├── UNMET DEPENDENCY @napi-rs/wasm-runtime@^1.0.5
│ │ │ ├── UNMET DEPENDENCY @tybys/wasm-util@^0.10.1
│ │ │ └── tslib@2.8.1
│ │ ├── @tailwindcss/oxide-win32-arm64-msvc@4.1.14
│ │ ├── @tailwindcss/oxide-win32-x64-msvc@4.1.14
│ │ ├── detect-libc@2.1.2 deduped
│ │ └─┬ tar@7.5.1
│ │   ├─┬ @isaacs/fs-minipass@4.0.1
│ │   │ └── minipass@7.1.2 deduped
│ │   ├── chownr@3.0.0
│ │   ├── minipass@7.1.2
│ │   ├─┬ minizlib@3.1.0
│ │   │ └── minipass@7.1.2 deduped
│ │   └── yallist@5.0.0
│ ├─┬ postcss@8.5.6
│ │ ├── nanoid@3.3.11
│ │ ├── picocolors@1.1.1
│ │ └── source-map-js@1.2.1 deduped
│ └── tailwindcss@4.1.14
└─┬ sharp@0.34.4
  ├── @img/colour@1.0.0
  ├─┬ @img/sharp-darwin-arm64@0.34.4
  │ └── @img/sharp-libvips-darwin-arm64@1.2.3 deduped
  ├─┬ @img/sharp-darwin-x64@0.34.4
  │ └── @img/sharp-libvips-darwin-x64@1.2.3 deduped
  ├── @img/sharp-libvips-darwin-arm64@1.2.3
  ├── @img/sharp-libvips-darwin-x64@1.2.3
  ├── @img/sharp-libvips-linux-arm@1.2.3
  ├── @img/sharp-libvips-linux-arm64@1.2.3
  ├── @img/sharp-libvips-linux-ppc64@1.2.3
  ├── @img/sharp-libvips-linux-s390x@1.2.3
  ├── @img/sharp-libvips-linux-x64@1.2.3
  ├── @img/sharp-libvips-linuxmusl-arm64@1.2.3
  ├── @img/sharp-libvips-linuxmusl-x64@1.2.3
  ├─┬ @img/sharp-linux-arm@0.34.4
  │ └── @img/sharp-libvips-linux-arm@1.2.3 deduped
  ├─┬ @img/sharp-linux-arm64@0.34.4
  │ └── @img/sharp-libvips-linux-arm64@1.2.3 deduped
  ├─┬ @img/sharp-linux-ppc64@0.34.4
  │ └── @img/sharp-libvips-linux-ppc64@1.2.3 deduped
  ├─┬ @img/sharp-linux-s390x@0.34.4
  │ └── @img/sharp-libvips-linux-s390x@1.2.3 deduped
  ├─┬ @img/sharp-linux-x64@0.34.4
  │ └── @img/sharp-libvips-linux-x64@1.2.3 deduped
  ├─┬ @img/sharp-linuxmusl-arm64@0.34.4
  │ └── @img/sharp-libvips-linuxmusl-arm64@1.2.3 deduped
  ├─┬ @img/sharp-linuxmusl-x64@0.34.4
  │ └── @img/sharp-libvips-linuxmusl-x64@1.2.3 deduped
  ├─┬ @img/sharp-wasm32@0.34.4
  │ └─┬ @emnapi/runtime@1.5.0
  │   └── tslib@2.8.1 deduped
  ├── @img/sharp-win32-arm64@0.34.4
  ├── @img/sharp-win32-ia32@0.34.4
  ├── @img/sharp-win32-x64@0.34.4
  ├── detect-libc@2.1.2
  └── semver@7.7.3

npm error code ELSPROBLEMS
npm error missing: @emnapi/core@^1.5.0, required by @tailwindcss/oxide-wasm32-wasi@4.1.14
npm error missing: @emnapi/wasi-threads@^1.1.0, required by @tailwindcss/oxide-wasm32-wasi@4.1.14
npm error missing: @napi-rs/wasm-runtime@^1.0.5, required by @tailwindcss/oxide-wasm32-wasi@4.1.14
npm error missing: @tybys/wasm-util@^0.10.1, required by @tailwindcss/oxide-wasm32-wasi@4.1.14

additional steps taken to identify/resolve the underlying issue shared below

$ node -v
v24.10.0
$ npm -v
11.6.1
$ npx create-next-app@latest my-app -ts -tw -eslint (if these options do not work please just select typescript, tailwind, and eslint from the prompt)

$ npm ls -all | grep -i invalid
│ │ │ ├─┬ @napi-rs/wasm-runtime@0.2.12 invalid: "^1.0.5" from node_modules/@tailwindcss/oxide-wasm32-wasi
│ │   │ └── @napi-rs/wasm-runtime@0.2.12 deduped invalid: "^1.0.5" from node_modules/@tailwindcss/oxide-wasm32-wasi
npm error code ELSPROBLEMS
npm error invalid: @napi-rs/wasm-runtime@0.2.12 /project/workspace/my-app/node_modules/@napi-rs/wasm-runtime


$ rm -rf node_modules/sharp   
$ rm package-lock.json     
$ npm cache clean --force

$ npm install


$ npm ls -all | grep -i invalid
$

and also here for node version 22 LTS

$ node -v
v22.10.0
$ npm -v
11.6.1

$ npx create-next-app@latest my-app -ts -tw -eslint
if flags are not working please select typescript, tailwind, and eslint


$ npm ls
my-app@0.1.0 /project/workspace/my-app
├── @emnapi/core@1.5.0 extraneous
├── @emnapi/runtime@1.5.0 extraneous
├── @emnapi/wasi-threads@1.1.0 extraneous
├── @eslint/eslintrc@3.3.1
├── @napi-rs/wasm-runtime@0.2.12 extraneous
├── @tailwindcss/postcss@4.1.14
├── @tybys/wasm-util@0.10.1 extraneous
├── @types/node@20.19.21
├── @types/react-dom@19.2.2
├── @types/react@19.2.2
├── eslint-config-next@15.5.5
├── eslint@9.37.0
├── next@15.5.5
├── react-dom@19.1.0
├── react@19.1.0
├── tailwindcss@4.1.14
└── typescript@5.9.3


$ npm ls -all | grep -i invalid
$ 
$ rm -rf node_modules/sharp 
$ rm package-lock.json
$ npm cache clean --force
$ npm install sharp --no-optional
$ npm ls            
my-app@0.1.0 /project/workspace/my-app
├── @eslint/eslintrc@3.3.1
├── @tailwindcss/postcss@4.1.14
├── @types/node@20.19.21
├── @types/react-dom@19.2.2
├── @types/react@19.2.2
├── eslint-config-next@15.5.5
├── eslint@9.37.0
├── next@15.5.5
├── react-dom@19.1.0
├── react@19.1.0
├── sharp@0.34.4
├── tailwindcss@4.1.14
└── typescript@5.9.3

$ npm ls -all | grep -i invalid
$

Sometimes removing the optional deps of Sharp resolved the issues entirely (as did it with tailwind or eslint). However, the sharp maintainer mentioned this is probably a question better suited for the @tailwindcss/oxide-wasm32-wasi maintainer and if not may be a bug with NPM.

Thank you!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions