aws-samples / aws-saas-factory-eks-saas-workshop

MIT No Attribution
56 stars 23 forks source link

Workshop error - Cannot find module "aws-cdk-lib" or its corresponding type declarations. #79

Closed nadimm90 closed 1 year ago

nadimm90 commented 1 year ago

I was trying to follow the steps mentioned on the aws workshop after running the ./scripts/on-your-own/setup.sh , I saw several warnings / errors

Installing Node and CDK
nom ERR! code EEXIST
pm ERR! path /home/ec2-user/.nvm/versions/node/v16.19.0/bin/cdk
npm ERR! EXIST: file already exists
nom ERR! File exists: /home/ec2-user/.nvm/versions/node/v16.19.0/bin/cdk
pm ERR! Remove the existing file and try again, or run npm
npm ERR! with
-force to overwrite files recklessly.
pm ERR! A complete log of this run can be found in:
nom ERR!
/home/ec2-user/.npm/_logs/2023-01-25T08_41_43_224Z-debug-0.log 

then I received a message saying Iam role is valid so I continued by running : source ./scripts/on-your-own/deploy-eks.sh but got the below error :

bash: varn: command not found
nom WARN exec The following package was not found and will be installed: ts-node@10.9.1
/home/ec2-user/.npm/_npx/1bf7c3c15bf47d04/node_modules/ts-node/src/index.ts:859
return new TError(diagnosticText, diagnosticCodes, diagnostics):
TSError:
× Unable to compile TypeScript:
bin/eks.ts:3:21 - error TS2307: Cannot find module
"aws-cdk-lib" or its corresponding type declarations.
3 import ( App 7 from 'aws-edk-Lib';
E
it
at createTSError(/home/ec2-user/.npm/_npx/1bf7c3c15bf47d04/node_modules/ts-node/src/index.ts:859:12)
at reportSError(/home/ecz-user/.npm/_npx/1bf7c3c15bf47d04/node_modules/ts-node/src/index.ts:863:19)
at getOutput (/home/ec2-user/.pm/_npx/1bf7c3c15bf47d04/node modules/ts-node/src/index.ts:1077:36)
at Object.compile (/home/ec2-user/.npm/_npx/1bf7c3c15bf47d04/node_modules/ts=node/src/index.ts:1433:41)
at Module.m._compile(/home/ecz-user/.npm/_npx/1bf7c3c15bf47d04/node_modules/ts-node/src/index.ts:1617:30)
at Module. extensions..js (node: internal/modules/cjs/loader:1219:10)
at Object.require.extensions.<computed> [as .ts](/home/ec2-user/.npm/_npx/1bf7c3c15bf47d04/node_modules/ts-node/src/index.ts:1621:12)
at Module. Load (node: internal/modules/cis/loader:1043:32)
at Function.Module._load (node:internal/modules/cjs/loader:878:12)
at Function. executeUserEntrvPoint las runMainl (node:internal/modules/run main: 81:12)
diagnosticCodes: [ 2307 ]
tobuck-aws commented 1 year ago

@nadimm90 thanks for reporting! I'll take a look and get report back here.

tobuck-aws commented 1 year ago

@nadimm90 this should be fixed. Please re-open this issue if not.