hesham badawy
02/23/2022, 4:53 PMnpx sst deploy --stage <STAGE_NAME>
i got that ERROR
"Cannot find module '../package.json'"
despite executeation of ls -a
lists it
.build
.gitignore
.sst
README.md
node_modules
package-lock.json
package.json
src
sst.json
stacks
test
tsconfig.json
Any help ?thdxr
02/23/2022, 4:54 PMhesham badawy
02/23/2022, 4:56 PMthdxr
02/23/2022, 4:56 PMhesham badawy
02/23/2022, 4:59 PMexport default class MyStack extends sst.Stack {
constructor(scope: <http://sst.App|sst.App>, id: string, props?: sst.StackProps) {
super(scope, id, props);
// Create a HTTP API
const api = new sst.Api(this, "Api", {
routes: {
"GET /": "src/lambda.handler",
},
});
const table = new Table(this, "Notes", {
partitionKey: {
name: "pk",
type: AttributeType.STRING,
},
sortKey: {
name: "sk0",
type: AttributeType.STRING,
},
});
// Show the endpoint in the output
this.addOutputs({
ApiEndpoint: api.url,
});
}
}
thdxr
02/23/2022, 5:02 PMhesham badawy
02/23/2022, 5:04 PMAdam Fanello
02/23/2022, 5:30 PMsst deploy
work when run locally, outside of CDK Pipeline?hesham badawy
02/23/2022, 5:49 PMAdam Fanello
02/23/2022, 5:51 PMhesham badawy
02/23/2022, 6:27 PMAdam Fanello
02/23/2022, 6:52 PMhesham badawy
02/23/2022, 7:27 PM[Container] 2022/02/23 19:24:11 Waiting for agent ping
[Container] 2022/02/23 19:24:12 Waiting for DOWNLOAD_SOURCE
[Container] 2022/02/23 19:24:22 Phase is DOWNLOAD_SOURCE
[Container] 2022/02/23 19:24:22 CODEBUILD_SRC_DIR=/codebuild/output/src802188544/src
[Container] 2022/02/23 19:24:22 YAML location is /codebuild/readonly/buildspec.yml
[Container] 2022/02/23 19:24:22 Processing environment variables
[Container] 2022/02/23 19:24:22 No runtime version selected in buildspec.
[Container] 2022/02/23 19:24:24 Moving to directory /codebuild/output/src802188544/src
[Container] 2022/02/23 19:24:24 Configuring ssm agent with target id: codebuild:057c793d-c055-4c47-8a92-389538ab7270
[Container] 2022/02/23 19:24:24 Successfully updated ssm agent configuration
[Container] 2022/02/23 19:24:24 Registering with agent
[Container] 2022/02/23 19:24:24 Phases found in YAML: 2
[Container] 2022/02/23 19:24:24 INSTALL: 1 commands
[Container] 2022/02/23 19:24:24 BUILD: 5 commands
[Container] 2022/02/23 19:24:24 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED
[Container] 2022/02/23 19:24:24 Phase context status code: Message:
[Container] 2022/02/23 19:24:24 Entering phase INSTALL
[Container] 2022/02/23 19:24:24 Running command npm cache --force clean && npm install --force
npm WARN using --force I sure hope you know what you are doing.
npm WARN using --force I sure hope you know what you are doing.
npm WARN @aws-sdk/middleware-sdk-s3@3.52.0 requires a peer of @aws-sdk/signature-v4-crt@^3.31.0 but none is installed. You must install peer dependencies yourself.
added 19 packages from 5 contributors and audited 1595 packages in 9.599s
114 packages are looking for funding
run `npm fund` for details
found 9 vulnerabilities (4 moderate, 2 high, 3 critical)
run `npm audit fix` to fix them, or `npm audit` for details
[Container] 2022/02/23 19:24:41 Phase complete: INSTALL State: SUCCEEDED
[Container] 2022/02/23 19:24:41 Phase context status code: Message:
[Container] 2022/02/23 19:24:41 Entering phase PRE_BUILD
[Container] 2022/02/23 19:24:41 Phase complete: PRE_BUILD State: SUCCEEDED
[Container] 2022/02/23 19:24:41 Phase context status code: Message:
[Container] 2022/02/23 19:24:41 Entering phase BUILD
[Container] 2022/02/23 19:24:41 Running command echo START BUILD
START BUILD
[Container] 2022/02/23 19:24:41 Running command pwd
/codebuild/output/src802188544/src
[Container] 2022/02/23 19:24:41 Running command ls -a
.
..
.build
.env
.gitignore
.sst
README.md
node_modules
package-lock.json
package.json
src
sst.json
stacks
test
tsconfig.json
[Container] 2022/02/23 19:24:41 Running command ls -a .build
.
..
cdk.out
eslint.js
lib
package.json
run.js
sst-debug.log
sst-merged.json
static-site-environment-output-keys.json
[Container] 2022/02/23 19:24:41 Running command npx sst deploy --stage hbstackcicd
Attention: SST now collects completely anonymous telemetry regarding usage. This is used to guide SST's roadmap.
You can learn more, including how to opt-out of this anonymous program, by heading over to:
<https://docs.serverless-stack.com/anonymous-telemetry>
Cannot find module '../package.json'
Require stack:
- /codebuild/output/src802188544/src/node_modules/.bin/sst
[Container] 2022/02/23 19:24:43 Command did not exit successfully npx sst deploy --stage hbstackcicd exit status 1
[Container] 2022/02/23 19:24:43 Phase complete: BUILD State: FAILED
[Container] 2022/02/23 19:24:43 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: npx sst deploy --stage hbstackcicd. Reason: exit status 1
[Container] 2022/02/23 19:24:43 Entering phase POST_BUILD
[Container] 2022/02/23 19:24:43 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2022/02/23 19:24:43 Phase context status code: Message:
Frank
.build
folder commited to git? It seems to be there prior to running sst deploy
hesham badawy
02/23/2022, 11:53 PMls -a
at build pahse/stage
[Container] 2022/02/23 23:24:34 Running command ls -a
.
..
.env
.gitignore
README.md
package-lock.json
package.json
src
sst.json
stacks
test
tsconfig.json
and the output of ls -a
at deployment stage after successfully build
[Container] 2022/02/23 23:27:08 Running command ls -a
.
..
.build
.env
.gitignore
.sst
README.md
node_modules
package-lock.json
package.json
src
sst.json
stacks
test
tsconfig.json
hesham badawy
02/24/2022, 12:43 AMFrank