amplify-cli: changed laptops and amplify won’t recognise existing project

I have changed laptops recently and when I run

amplify publish -c

I get this error:

Error: You are not working inside a valid amplify project. Use ‘amplify init’ in the root of your app directory to initialize your project with Amplify

I created an aws cloudfront through amplify previously but is it possible to reinitialise amplify on a new machine.

i committed all files to source control so i can’t understand from the error message what is missing

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Here’s the .config folder structure: amplify |_.config |_aws-info.json |_project-config.json

Here’s a sample of these above mentioned config files. Plase fill/substitue it with your custom information.

aws-info.json

{
    "configLevel": "project",
    "useProfile": true,
    "profileName": "default"
}

project-config.json

{
    "projectName": "testbeta",
    "projectPath": "/Users/kaustavg/testbeta",
    "defaultEditor": "sublime",
    "frontendHandler": {
        "javascript": "amplify-frontend-javascript"
    },
    "javascript": {
        "framework": "none",
        "config": {
            "SourceDir": "src",
            "DistributionDir": "dist",
            "BuildCommand": "npm run-script build",
            "StartCommand": "npm run-script start"
        }
    },
    "providers": {
        "awscloudformation": "amplify-provider-awscloudformation"
    }
}

You can run amplify configure project command to modify any of these values int he future.

@dagda1 We don’t create a .amplify dir but create a amplify/.config directory which seems to be missing in your case. Would it be possible to retreive the amplify/.config directory?

@dagda1 When you changed laptops did you run the amplify configure project command from the root of your project? If not, then please run that and then execute the subsequent commands.