You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行cdk deploy部署AWS CDK堆栈时遭遇错误

AWS CDK部署报错排查记录

问题背景

  • 最初怀疑问题源于用户文件夹名称含空格(实际用户名为Firstname Lastname,而非无空格的Firstname),已为用户文件夹创建无空格符号链接,并更新环境变量指向该链接。
  • 通过--verbose参数排查发现,错误发生在执行cdk.json中配置的命令:dotnet run --project src/MyCdkCodepipeline/MyCdkCodepipeline.csproj。
  • 项目是通过cdk init app --language csharp新建的全新项目。

环境版本信息

  • Node: 20.10.0
  • Npm: 8.19.4
  • AWS CDK: 2.132.1(build 9df7dd3)
  • AWS CLI: aws-cli/2.4.7 Python/3.8.8 Windows/10 exe/AMD64 prompt/off

执行cdk deploy时的堆栈跟踪

Unhandled exception. Amazon.JSII.Runtime.JsiiError: Child process exited unexpectedly!
   at Amazon.JSII.Runtime.Services.Runtime.ReadResponse()
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Hello()
   at Amazon.JSII.Runtime.Services.ServiceContainer.BuildServiceProvider(ILoggerFactory loggerFactoryOverride)
   at Amazon.JSII.Runtime.Services.ServiceContainer.<>c.<.cctor>b__8_0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Amazon.JSII.Runtime.Services.ServiceContainer.get_ServiceProvider()
   at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
   at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
   at Amazon.JSII.Runtime.Deputy.DeputyBase..ctor(DeputyProps props)
   at Constructs.Construct..ctor(DeputyProps props)
   at Amazon.CDK.Stage..ctor(DeputyProps props)
   at Amazon.CDK.App..ctor(IAppProps props)
   at NhomeCdkCodepipeline.Program.Main(String[] args) in C:\Git\NEMS\nems-home\NhomeCdkCodepipeline\src\NhomeCdkCodepipeline\Program.cs:line 12
node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module 'C:\Users\Firstname'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.10.0

Subprocess exited with error 3762504530

内容的提问来源于stack exchange,提问作者Sannitie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 07:55:24