this error is pretty vague, anyone have an idea of...
# general
i
this error is pretty vague, anyone have an idea of what's going on here or how I can debug?
Copy code
Created stack 'dev'
Previewing update (dev):
     Type                 Name              Plan     Info
     pulumi:pulumi:Stack  azurenetwork-dev           1 message
 
Diagnostics:
  pulumi:pulumi:Stack (azurenetwork-dev):
    error: It looks like the Pulumi SDK has not been installed. Have you run npm install or yarn install?
 
error: failed to load language plugin nodejs: could not read plugin [/Users/jonbrwn/.pulumi/bin/pulumi-language-nodejs] stdout: EOF
c
Just like the error says `error: It looks like the Pulumi SDK has not been installed. Have you run npm install or yarn install?`…have you run either
npm install
or
yarn install
?
When you run
pulumi new
to setup a new project/stack, it runs it automatically for you unless you canceled out of it before it can.
..in which case, you should restore the
npm
dependencies on your own.
i
yes, I previously attempted to run
npm install
in the same directory and the error still appears.
the error is propagated from running the
pulumi-language-nodejs
binary
b
what does your package.json look like @icy-engineer-10830?
i
this fixed it:
npm install --save @pulumi/pulumi
not sure if the problem had to do with a recent npm update or a pulumi update
c
Hmm that package would have been installed, by default, when you bootstrapped the new project. How did you create your project/stack? Did you use
pulumi new
at all?
i
@clever-sunset-76585 no, is that recommended for automated projects?
c
No it is not a recommendation per se. It’s a convenient way to create a new project with the default packages that are needed. You can always create a new project, and stack running the individual commands as you need, but you should make sure that you always add the core
npm
packages as
dependencies
(speaking for the NodeJS runtime, of course.) The core dependencies being the
@pulumi/pulumi
and the respective provider package, i.e.
@pulumi/aws
,
@pulumi/kubernetes
,
@pulumi/azure
etc.
Also what do you mean by “automated projects”?
i
@clever-sunset-76585 projects that are predefined and shared. so should a package.json be included in the directory to ensure those get installed? i.e. making sure users run
npm install
and then
pulumi up
c
so should a package.json be included in the directory to ensure those get installed? i.e. making sure users run `npm install`and then
pulumi up
Yes. It should be in the same directory as your pulumi app code, i.e. where the
index.ts
file is located.
i
got it, thanks
c
Also, not sure if you have seen our tutorials (which sources examples from the examples repo), but have a look at: https://www.pulumi.com/docs/tutorials/ or if you prefer browsing the GitHub repo directly: https://github.com/pulumi/examples