Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Hosting Error #13339

Closed
2 tasks done
Ciara-Cloud opened this issue Oct 17, 2023 · 3 comments
Closed
2 tasks done

Adding Hosting Error #13339

Ciara-Cloud opened this issue Oct 17, 2023 · 3 comments
Labels
hosting Issues tied to hosting category pending-response Issue is pending response from the issue author pending-triage Issue is pending triage

Comments

@Ciara-Cloud
Copy link

Ciara-Cloud commented Oct 17, 2023

How did you install the Amplify CLI?

npm install -g @aws-amplify/cli

If applicable, what version of Node.js are you using?

v16.20.2

Amplify CLI Version

12.7.0

What operating system are you using?

Cloud9 running on Amazon Linux 2
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
SUPPORT_END="2025-06-30"

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No changes have been made to resources managed by Amplify

`

Describe the bug

When adding hosting via Amplify CLI I get error

npm ERR! Missing script: "build"

Comand & Full Error output

$ amplify add hosting
✔ Select the plugin module to execute · Amazon CloudFront and S3
✔ hosting bucket name · mycliapp-bucket
Static webhosting is disabled for the hosting bucket when CloudFront Distribution is enabled.

You can now publish your app using the following command:
Command: amplify publish

$ ~/environment $ amplify publish
✔ Successfully pulled backend environment dev from the cloud.

    Current Environment: dev
    
┌──────────┬───────────────────────┬───────────┬───────────────────┐
│ Category │ Resource name         │ Operation │ Provider plugin   │
├──────────┼───────────────────────┼───────────┼───────────────────┤
│ Hosting  │ S3AndCloudFront       │ Create    │ awscloudformation │
├──────────┼───────────────────────┼───────────┼───────────────────┤
│ Function │ MyFirstLambdaFunction │ No Change │ awscloudformation │
├──────────┼───────────────────────┼───────────┼───────────────────┤
│ Api      │ MyFirstAPI            │ No Change │ awscloudformation │
└──────────┴───────────────────────┴───────────┴───────────────────┘
✔ Are you sure you want to continue? (Y/n) · yes

Deployment completed.
Deployed root stack MyAppFromCLI [ ======================================== ] 4/4
        amplify-myappfromcli-dev-80043 AWS::CloudFormation::Stack     UPDATE_COMPLETE                Tue Oct 17 2023 09:03:27…     
        hostingS3AndCloudFront         AWS::CloudFormation::Stack     CREATE_COMPLETE                Tue Oct 17 2023 09:03:22…     
        functionMyFirstLambdaFunction  AWS::CloudFormation::Stack     UPDATE_COMPLETE                Tue Oct 17 2023 08:59:20…     
        apiMyFirstAPI                  AWS::CloudFormation::Stack     UPDATE_COMPLETE                Tue Oct 17 2023 08:59:22…     
Deployed hosting S3AndCloudFront [ ======================================== ] 4/4
        S3Bucket                       AWS::S3::Bucket                CREATE_COMPLETE                Tue Oct 17 2023 08:59:45…     
        OriginAccessIdentity           AWS::CloudFront::CloudFrontOr… CREATE_COMPLETE                Tue Oct 17 2023 08:59:24…     
        CloudFrontDistribution         AWS::CloudFront::Distribution  CREATE_IN_PROGRESS             Tue Oct 17 2023 08:59:46…     
        PrivateBucketPolicy            AWS::S3::BucketPolicy          CREATE_COMPLETE                Tue Oct 17 2023 08:59:48…     

Deployment state saved successfully.

Hosting endpoint: 

npm ERR! Missing script: "build"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in: /home/ec2-user/.npm/_logs/2023-10-17T09_03_50_431Z-debug-0.log
frontend build command exited with code 1
🛑 1

Expected behavior

configure hosting

Reproduction steps

amplify-config.txt

Project Identifier

File above attached with commands run

Log output

# Put your logs below this line

[2023-10-17T09_03_50_431Z-debug-0.log](https://github.com/aws-amplify/amplify-cli/files/12926722/2023-10-17T09_03_50_431Z-debug-0.log)

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@Ciara-Cloud Ciara-Cloud added the pending-triage Issue is pending triage label Oct 17, 2023
@ykethan
Copy link
Member

ykethan commented Oct 17, 2023

Hey @doitwithciara, thank you for reaching out. From the issue, it appears the package.json does not have the build script configured. Additionally, noticed that no Javascript framework was selected on amplify init.
Does the application have a frontend framework?

@ykethan ykethan added hosting Issues tied to hosting category pending-response Issue is pending response from the issue author labels Oct 17, 2023
@ykethan
Copy link
Member

ykethan commented Dec 13, 2023

closing the issue due to inactivity. please feel free in reaching out to us, we would be happy in diving deeper.

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2023
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hosting Issues tied to hosting category pending-response Issue is pending response from the issue author pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants