因此,我在其package.json中有一个名为backend的Typescript项目,具有类似的缺点:
"dependencies": {
"@the-couple-game/helpers": "^1.0.0",
}
并且助手(也包括Typescript)位于另一个文件夹中,其package.json如下:
{
"name": "@the-couple-game/helpers",
}
因此,运行lerna bootstrap应该将两者链接在一起,并在本地执行的后端node_modules中安装@ the-couple-game / helpers。
但是,使用下面的buildspec.yml使用Codebuild进行相同的操作(使用--no-ci,因为我不希望使用npm ci)不会在后端的node_modules中添加@ the-couple-game / helpers。因此,如果我运行后端的已转译的index.js,它将抱怨缺少模块。
version: 0.1
phases:
install:
commands:
- npm install -g lerna
pre_build:
commands:
- lerna bootstrap --no-ci --concurrency 4
build:
commands:
- lerna run build --concurrency 4
artifacts:
files:
- "**/*"
目前,我不得不诉诸于部署到CodeDeploy之后(使用从appspec.yml调用的脚本)手动进行lerna引导,以便它安装缺少的模块,但Codebuild不应涵盖该部分吗?
谢谢。
因此事实证明,AWS CodePipeline不支持源代码中的符号链接(在我的情况下为Codebuild)。 Reference
因此,在部署之后,我将不得不使用shell脚本来创建链接,这对于我的micro ec2实例而言并不是一件昂贵的工作。