Back to TIL
May 2025
posted on 05.10.2025

Use pnpm's shell-emulator to execute scripts on all platforms

pnpm can do cross-platform scripting when shell-emulator is enabled.

# .npmrc
shell-emulator=true

It means scripts like this will work across all platforms:

"scripts": {
  "serve": "NODE_ENV=production node server"
}

It is powered by @yarnpkg/shell and it replaces the need to use libraries like cross-env.

Learn More

No reactions yet

in Naperville, IL
Last visitor from Mitaka, Japan