Quantcast
Channel: Node.jsタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 8691

aws-serverless-expressのサンプル動かないんだけど

$
0
0

動かないやつ

https://github.com/awslabs/aws-serverless-express/tree/master/examples/basic-starter
npm run setup

出てたエラー

An error occurred (ValidationError) when calling the CreateChangeSet operation: Stack:arn:aws:cloudformation:ap-northeast-1:363880502757:stack/AwsServerlessExpressStack/aaaaaaaaaaaaaaaaaaa is in ROLLBACK_COMPLETE state and can not be updated.
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! aws-serverless-express-example@2.1.1 deploy: `aws cloudformation deploy --template-file packaged-sam.yaml --stack-name $npm_package_config_cloudFormationStackName --capabilities CAPABILITY_IAM --region $npm_package_config_region`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the aws-serverless-express-example@2.1.1 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aaaaa/.npm/_logs/2020-05-17T15_40_32_799Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! aws-serverless-express-example@2.1.1 package-deploy: `npm run package && npm run deploy`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the aws-serverless-express-example@2.1.1 package-deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aaaaaaaa/.npm/_logs/2020-05-17T15_40_32_816Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! aws-serverless-express-example@2.1.1 setup: `npm install && (aws s3api get-bucket-location --bucket $npm_package_config_s3BucketName --region $npm_package_config_region || npm run create-bucket) && npm run package-deploy`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the aws-serverless-express-example@2.1.1 setup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aaaaaaaa/.npm/_logs/2020-05-17T15_40_32_832Z-debug.log

色々すっ飛ばして結論

  • runtime のnodeバージョンが古い(サンプルの8系がサポート終わってる(直せや

どうするか

  • サンプルプロジェクト内の cloudformation.ymalの 60行目付近の Runtimeを書き換える
    • Runtime: nodejs8.10 -> Runtime: nodejs12.x
    • xがミソ。バージョン指定すると動かない

は?動かないんだけど

  • RollBack出来ないとかなんとかなので一回Stackを消してから npm run setupしてみよう。

おわり


Viewing all articles
Browse latest Browse all 8691

Trending Articles