Is it possible to pass node.js CLI arguments to `p...
# getting-started
b
Is it possible to pass node.js CLI arguments to
pulumi up
? I'm working with a typescript monorepo and it would be cool to have my pulumi infrastructure be a package inside of that monorepo like the others - but the monorepo manages dependencies through Yarn PnP (with corepack) which means we need to pass a
-r ./.pnp.cjs
flag to
node
for dependencies like
@pulumi/pulumi
to resolve
l
Yes, though it's still considered an experimental feature. You do it through Pulumi.yaml. Let me find the syntax for you...
Add a
nodeargs
property to the
runtime:options
object. So you need a block like this in your Pulumi.yaml:
Copy code
runtime:
  name: nodejs
  options:
    nodeargs: -r ./pnp.cjs
b
Good to know this option exists. I ended up solving my issue in a different way. Because the pulumi node SDK depends on the existance of
node_modules
on the filesystem, just
-r ./.pnp.cjs
isn't enough, but using yarn's pnpify shim is. https://github.com/pulumi/pulumi/issues/3586#issuecomment-782589776
Thank you either way!