hi everyone! following <pulumi-provider-boilerplat...
# contribute
b
hi everyone! following pulumi-provider-boilerplate readme step by step, using the exact commands on ubuntu 20.04, i got the follow error when `pulumi up`:
Copy code
Type                 Name         Plan       Info
 +   pulumi:pulumi:Stack  simple-test  create     1 error
 
Diagnostics:
  pulumi:pulumi:Stack (simple-test):
    error: Running program '/home/tingkai/pulumi/pulumi-oneandone/examples/simple' failed with an unhandled exception:
    TSError: ⨯ Unable to compile TypeScript:
    ../../sdk/nodejs/index.ts(4,25): error TS2307: Cannot find module '@pulumi/pulumi'.
    
        at createTSError (/home/tingkai/pulumi/pulumi-oneandone/examples/simple/node_modules/ts-node/src/index.ts:261:12)
        at getOutput (/home/tingkai/pulumi/pulumi-oneandone/examples/simple/node_modules/ts-node/src/index.ts:367:40)
        at Object.compile (/home/tingkai/pulumi/pulumi-oneandone/examples/simple/node_modules/ts-node/src/index.ts:558:11)
        at Module.m._compile (/home/tingkai/pulumi/pulumi-oneandone/examples/simple/node_modules/ts-node/src/index.ts:439:43)
        at Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
        at Object.require.extensions.<computed> [as .ts] (/home/tingkai/pulumi/pulumi-oneandone/examples/simple/node_modules/ts-node/src/index.ts:442:12)
        at Module.load (node:internal/modules/cjs/loader:988:32)
        at Function.Module._load (node:internal/modules/cjs/loader:828:14)
        at Module.require (node:internal/modules/cjs/loader:1012:19)
        at require (node:internal/modules/cjs/helpers:93:18)
how could i fix this?
t
Sorry for inconvenience. I have a fork which is a somewhat better boilerplate IMO, also in terms of providing the
make
file: https://github.com/mikhailshilkov/pulumi-provider-boilerplate
❤️ 1
I think that the make file will work for the original repo if you copy it
The key there is
build_nodejs
and
install_nodejs_sdk
But - looking at the actual error you get - maybe you just need to run
npm install
?
b
@tall-librarian-49374 can we upstream some of your template back to the pulumi/pulumi one?
t
We should discuss that. I have two boilerplates + the one upstream - we should reconcile them.
👍 1
b
i did run
npm install
as following the readme. lm try the boilerplate you linked. thanks very much for helping!
thanks, i have tried mikhail's fork, i got the following error when doing `make build`:
Copy code
...
cd sdk/nodejs/ && \
yarn install && \
node --max-old-space-size=4096 /usr/local/bin/tsc --diagnostics && \
cp ../../README.md ../../LICENSE package.json yarn.lock ./bin/ && \
sed -i.bak -e "s/\${VERSION}/v0.0.1-alpha.1622556506+7b638491.dirty/g" ./bin/package.json
yarn install v1.22.10
warning package.json: No license field
info No lockfile found.
warning @pulumi/xyz@${VERSION}: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 3.49s.
node:internal/modules/cjs/loader:943
  throw err;
  ^

Error: Cannot find module '/usr/local/bin/tsc'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
    at Function.Module._load (node:internal/modules/cjs/loader:773:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
make: *** [Makefile:28: build_nodejs] Error 1
did i miss anything? to reproduce: clone the repo,
make ensure
,
make build
t
Oh, I see the problem, let me try a fix
Try to pull and run again
b
thanks for the fix! tried again:
Copy code
yarn install v1.22.10
warning package.json: No license field
info No lockfile found.
warning @pulumi/xyz@${VERSION}: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 3.79s.
/bin/bash: line 2: tsc: command not found
make: *** [Makefile:28: build_nodejs] Error 127
then i did
npm install typescript -g
then i got
Copy code
success Saved lockfile.
Done in 3.39s.
cd sdk/dotnet/ && \
        echo "azure-native\n0.0.1-alpha.1626114196+eb4d21e0.dirty" >version.txt && \
        dotnet build /p:Version=0.0.1-alpha.1626114196+eb4d21e0.dirty
/bin/bash: line 2: dotnet: command not found
make: *** [Makefile:46: build_dotnet] Error 127
i guess i need to install dotnet environment as well. but i wonder if i am going to develop a pulumi provider in python, can i just comment out all the
dotnet
part in Makefile? update:
pulumi up
is successful!
t
can i just comment out all the 
dotnet
 part in Makefile?
You can
🙌 1
1