Documentación offline pnpm main

Shellemulator

main Documentación oficial Licencia MITDescargado el 2026-08-02

En esta página

shellEmulator#

  • Default: false
  • Type: Boolean

When true, pnpm will use a JavaScript implementation of a bash-like shell to execute scripts.

This option simplifies cross-platform scripting. For instance, by default, the next script will fail on non-POSIX-compliant systems:

"scripts": {
  "test": "NODE_ENV=test node test.js"
}

But if the shellEmulator setting is set to true, it will work on all platforms.

:::note

Node.js 22 or higher supports running scripts without pnpm's assistance. For the example above, you can run the test script with node --run test. However, the shellEmulator option has no effect on this. Scripts that depend on POSIX features are required to be run pnpm run instead of node --run to work in non-POSIX-compliant environments.

:::