![](/img/trans.png)
[英]How do I get public DNS after creating AWS EC2 instance with CDK?
[英]AWS CDK: AWS-ec2 SyntaxError: Unexpected token '.' after update node
我更新 NX 和相關版本。 所以現在使用節點14.15.0
而不是節點12.20.2
節點版本更新。 所以我更新了aws-cdk
包。 但現在以下命令不再起作用。 問題是aws-ec2
中的可選鏈接運算符。
npx env-cmd -f pipeline.json npx ts-node --project./scripts/tsconfig.json./apps/cloud-infrastructure/src/bin/pre-build.ts
執行上述命令時出現以下錯誤。
節點版本14.15.0
。 (也試過另一個版本)
ts config tsconfig.base.json
中的編譯器選項
"compileOnSave": false,
"compilerOptions": {
"rootDir": ".",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"module": "esnext",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom",
"esnext.asynciterable"
],
"skipLibCheck": true,
"skipDefaultLibCheck": true
}
"files": [
"./polyfills.localize.ts"
],
"exclude": [
"node_modules",
"tmp"
]
配置文件
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"types": ["node", "jest"],
"lib": ["ES6", "ES2017", "es2015", "ES2020.Promise"],
"module": "CommonJS"
},
"include": ["**/*.ts"]
}
如 GitHub 問題的答案所述,您可能需要將 Node 從 12 更新(更新到 14 或 16)。 執行此操作的最佳方法是更新您的 package 文件,運行npm update
,然后解決依賴性問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.