Amplify build error - Cannot find module '/codebuild/output/....
0
Hi all
My vue app is running fine locally and builds fine locally, however, I'm trying to build my app on Amplify using a link to my github repo. The link and the clone work fine but I'm getting an error during the build.
Amplify push also works fine without problems.
I've only ever used NPM for all modules along with the vue-cli and Amplify-cli.
I have no idea where to start with this.
The main error seems to be :
Cannot find module '/codebuild/output/src323788196/src/.yarn/releases/yarn-1.23.0-20210726.1745.cjs'
I've tried yarn install
but that does not help. I'm not sure what to do next because I've never used yarn at all in this project.
My build config is standard -
version: 1
backend:
phases:
build:
commands:
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
frontend:
phases:
preBuild:
commands:
- npm install
build:
commands:
- npm run build
artifacts:
baseDirectory: dist
files:
- '**/*'
cache:
paths:
- node_modules/**/*
The error I'm getting is -
[WARNING]: ✖ An error occurred when pushing the resources to the cloud
2022-01-04T06:47:49.986Z [WARNING]: ✖ There was an error initializing your environment.
2022-01-04T06:47:49.993Z [INFO]: [0mError: Packaging lambda function failed with the error [0m
[0mCommand failed with exit code 1: yarn --production[0m
[0minternal/modules/cjs/loader.js:818[0m
[0m throw err;[0m
[0m ^[0m
[0mError: Cannot find module '/codebuild/output/src323788196/src/.yarn/releases/yarn-1.23.0-20210726.1745.cjs'[0m
[0m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)[0m
[0m at Function.Module._load (internal/modules/cjs/loader.js:667:27)[0m
[0m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)[0m
[0m at internal/main/run_main_module.js:17:47 {[0m
[0m code: 'MODULE_NOT_FOUND',[0m
[0m requireStack: [][0m
[0m}[0m
[0m at runPackageManager (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-nodejs-function-runtime-provider/src/utils/legacyBuild.ts:66:13)[0m
[0m at installDependencies (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-nodejs-function-runtime-provider/src/utils/legacyBuild.ts:40:3)[0m
[0m at Object.buildResource [as build] (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-nodejs-function-runtime-provider/src/utils/legacyBuild.ts:13:5)[0m
[0m at buildFunction (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-function/src/provider-utils/awscloudformation/utils/buildFunction.ts:41:36)[0m
[0m at prepareResource (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/push-resources.ts:605:33)[0m
[0m at async Promise.all (index 1)[0m
[0m at prepareBuildableResources (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/push-resources.ts:601:10)[0m
[0m at Object.run (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/push-resources.ts:173:5)[0m
2022-01-04T06:47:50.024Z [ERROR]: !!! Build failed
2022-01-04T06:47:50.024Z [ERROR]: !!! Non-Zero Exit Code detected
語言
English
已提問 2 年前檢視次數 129 次lg...
沒有答案
- 最新
- 最多得票
- 最多評論
相關內容
- 已提問 9 個月前lg...
- 已提問 9 個月前lg...
- 已提問 1 年前lg...
- 已提問 4 個月前lg...
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前