Skip to content

yarn node

run node with the hook already setup

Terminal window
yarn node ...

Run a Node script :

Terminal window
yarn node ./my-script.js

This command simply runs Node. It also makes sure to call it in a way that’s compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).

The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.