我删除了
/node_modules
和/package-lock.json
并做了npm install
。
此后,当我做
npx sst start
时,我收到此错误:
TypeError: getAwsCredentials is not a function.
怎么解决这个问题?
包.json
旧:
“@serverless-stack/cli”:“0.69.2”,
“@serverless-stack/resources”:“0.69.2”,
新:
“@serverless-stack/cli”:“0.69.6”,
“@serverless-stack/resources”:“0.69.6”,
我将
@serverless-stack/static-site-env
从0.63.0
更新到最新,1.18.4
截至我发布此答案并解决问题时,npm install @serverless-stack/static-site-env@latest
。就我而言,错误是:
Error: statement.freeze is not a function
Trace: TypeError: statement.freeze is not a function
at PolicyDocument.freezeStatements (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/aws-iam/lib/policy-document.js:1:4964)
at PolicyDocument._splitDocument (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/aws-iam/lib/policy-document.js:1:3223)
at Role.splitLargePolicy (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/aws-iam/lib/role.js:1:12079)
at Object.visit (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/aws-iam/lib/role.js:1:7745)
at recurse (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:2:2282)
at recurse (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:2:2646)
at recurse (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:2:2646)
at recurse (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:2:2646)
at recurse (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:2:2646)
at invokeAspects (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:2:1906)
at synthesize (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:1:1450)
at App.synth (/Users/jmquij0106/git/charcot/node_modules/aws-cdk-lib/core/lib/stage.js:1:2263)
at synthInRoot (file:///Users/jmquij0106/git/charcot/node_modules/sst/stacks/synth.js:58:34)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Module.synth (file:///Users/jmquij0106/git/charcot/node_modules/sst/stacks/synth.js:19:16)
at async buildApp (file:///Users/jmquij0106/git/charcot/node_modules/sst/cli/commands/bind.js:86:13)
at async Object.handler (file:///Users/jmquij0106/git/charcot/node_modules/sst/cli/commands/bind.js:53:9)
at process.<anonymous> (file:///Users/jmquij0106/git/charcot/node_modules/sst/cli/sst.js:58:21)
at process.emit (node:events:525:35)
at process.emit (node:domain:489:12)
at process._fatalException (node:internal/process/execution:149:25)
at processPromiseRejections (node:internal/process/promises:288:13)
at process.processTicksAndRejections (node:internal/process/task_queues:96:32)
Need help with this error? Post it in #help on the SST Discord https://sst.dev/discord