Skip to main content

yarn node

Run node with the hook already setup.

Usage

$ yarn node ...

Examples

Run a Node script :

yarn node ./my-script.js

Details

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.