https://pulumi.com logo
#getting-started
Title
# getting-started
b

bright-horse-50102

03/22/2022, 9:29 PM
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

little-cartoon-10569

03/22/2022, 9:55 PM
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

bright-horse-50102

03/22/2022, 10:26 PM
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!
4 Views