amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

`amplify init` step "Select the backend providers" shows empty list

Open gabehollombe-aws opened this issue 7 years ago • 15 comments

Describe the bug During an amplify init (using @aws-amplify/cli version 4.1.1) I get a step that reads

? Select the backend providers. (Press <space> to select, <a> to toggle all, <i> to invert selection)

But this shows an empty list. Subsequent attempts to add resources (like amplify add api) fail. See full transcript below.

Amplify CLI Version

➜  foo amplify --version
4.1.1

➜  foo node --version
v12.11.0

➜  foo system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 10.14.6 (18G103)
      Kernel Version: Darwin 18.7.0

To Reproduce

➜  foo amplify init
Note: It is recommended to run this command from the root of your app directory
? Enter a name for the project foo
? Enter a name for the environment dev
? Choose your default editor: Visual Studio Code

? Choose the type of app that you're building javascript
Please tell us about your project
? What javascript framework are you using none
? Source Directory Path:  src
? Distribution Directory Path: dist
? Build Command:  npm run-script build
? Start Command: npm run-script start
? Select the backend providers. (Press <space> to select, <a> to toggle all, <i> to invert selection)
✔ Initialized provider successfully.
Initialized your environment successfully.

Your project has been successfully initialized and connected to the cloud!

Some next steps:
"amplify status" will show you what you've added already and if it's locally configured or deployed
"amplify <category> add" will allow you to add features like user login or a backend API
"amplify push" will build all your local backend resources and provision it in the cloud
“amplify console” to open the Amplify Console and view your project status
"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud

Pro tip:
Try "amplify add api" to create a backend API and then "amplify publish" to deploy everything

➜  foo amplify add api
No services defined by configured providers for category: api

gabehollombe-aws avatar Nov 27 '19 06:11 gabehollombe-aws

I have the same problem

bastianbb avatar Nov 27 '19 08:11 bastianbb

Same here.

And also get this, if i try to amplify configure

amplify --version  4.1.1
node --version v12.13.0

System Software Overview:

      System Version: macOS 10.15.1 (19B88)
      Kernel Version: Darwin 19.0.0

paulgrotzke avatar Nov 27 '19 08:11 paulgrotzke

Same here

aryatmajaya avatar Nov 27 '19 09:11 aryatmajaya

Same here, please help

oahmaro avatar Nov 27 '19 12:11 oahmaro

I also have this Problem. Tried to install older amplify versions, but did not change anything. Please help.

Mactory avatar Nov 27 '19 13:11 Mactory

I'm also getting this error at the moment, and trying to downgrade amplify-cli to 3.17.0 didn't help.

azatoth@azaboxen:~/Project/purplescout/domino-video-archive «next *$»$ git clear
Sure? - This command may delete files that cannot be recovered, including those in .gitignore [y/N]: y
Removing amplify/#current-cloud-backend/
Removing amplify/.config/local-env-info.json
Removing amplify/backend/amplify-meta.json
Removing node_modules/
HEAD is now at ddf469f update package depends and switch to yarn
azatoth@azaboxen:~/Project/purplescout/domino-video-archive «next $»$ yarn install
yarn install v1.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "aws-appsync > [email protected]" has incorrect peer dependency "graphql@^0.11.0".
warning " > [email protected]" has unmet peer dependency "@react-native-community/[email protected]".
warning " > [email protected]" has unmet peer dependency "apollo-client@^2.6.3".
warning " > [email protected]" has unmet peer dependency "eslint@>= 4.12.1".
warning " > [email protected]" has unmet peer dependency "@typescript-eslint/[email protected]".
warning " > [email protected]" has unmet peer dependency "@typescript-eslint/[email protected]".
warning " > [email protected]" has unmet peer dependency "[email protected]".
warning " > [email protected]" has incorrect peer dependency "[email protected]".
warning " > [email protected]" has incorrect peer dependency "[email protected]".
warning " > [email protected]" has unmet peer dependency "[email protected] - 6.x".
warning " > [email protected]" has unmet peer dependency "eslint@^3 || ^4 || ^5 || ^6".
warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > [email protected]" has unmet peer dependency "eslint@>= 3.2.1".
warning " > [email protected]" has unmet peer dependency "eslint@>=6.1.0".
warning " > [email protected]" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0".
warning " > [email protected]" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0".
[4/4] Building fresh packages...
Done in 24.14s.
azatoth@azaboxen:~/Project/purplescout/domino-video-archive «next $»$ amplify init
Note: It is recommended to run this command from the root of your app directory
? Do you want to use an existing environment? Yes
? Choose the environment you would like to use: dev
? Choose your default editor: Visual Studio Code
? Select the backend providers. (Press <space> to select, <a> to toggle all, <i> to invert selection)
✔ Initialized provider successfully.
✖ There was an error initializing your environment.
init failed
Error: ENOENT: no such file or directory, open '/home/azatoth/Project/purplescout/domino-video-archive/amplify/#current-cloud-backend/amplify-meta.json'
    at Object.openSync (fs.js:440:3)
    at Object.readFileSync (fs.js:342:35)
    at readJsonFile (/home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/read-json-file.js:10:35)
    at AmplifyToolkit.<anonymous> (/home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/resource-status.js:196:34)
    at Generator.next (<anonymous>)
    at /home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/resource-status.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/resource-status.js:4:12)
    at AmplifyToolkit.getResourceStatus [as _getResourceStatus] (/home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/resource-status.js:188:12)
    at initEnv (/home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/index.js:189:94) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/azatoth/Project/purplescout/domino-video-archive/amplify/#current-cloud-backend/amplify-meta.json'
}
azatoth@azaboxen:~/Project/purplescout/domino-video-archive «next *$»$ amplify env checkout dev --restore
The 'request' argument must be string. Received type undefined
TypeError [ERR_INVALID_ARG_TYPE]: The 'request' argument must be string. Received type undefined
    at /home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/node_modules/esm/esm.js:1:224803
    at Object.<anonymous> (/home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/node_modules/esm/esm.js:1:251922)
    at Object.t (/home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/node_modules/esm/esm.js:1:279775)
    at n (/home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/node_modules/esm/esm.js:1:279589)
    at /home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/lib/commands/env/checkout.js:41:36
    at Array.forEach (<anonymous>)
    at /home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/lib/commands/env/checkout.js:40:49
    at Generator.next (<anonymous>)
    at /home/azatoth/.npm-global/lib/node_modules/@aws-amplify/cli/lib/commands/env/checkout.js:8:71
    at new Promise (<anonymous>)

azatoth avatar Nov 27 '19 14:11 azatoth

I did find a way to rollback and make it work; and it's clearly 100% logical this is what needs to be done...

npm install -g @aws-amplify/[email protected]
amplify plugin scan

azatoth avatar Nov 27 '19 14:11 azatoth

https://github.com/aws-amplify/amplify-cli/issues/2854#issuecomment-559122125

Can confirm this worked for me as well.

TheodoreASW avatar Nov 27 '19 15:11 TheodoreASW

It appears a dependency was missing but our CI process didn't flag and stop a build. We're in the process of resolving this and pushing out a new version, then we'll deep dive into why the dependency didn't get flagged. I'll respond here once the new build is out.

yuth avatar Nov 27 '19 15:11 yuth

is this error that I started to see in the console during the backend build phase related?

image

blomm avatar Nov 27 '19 16:11 blomm

We have released Amplify CLI version 4.2.0 which should fix this error. Please feel free to re-open or comment if you're still facing issue with Amplify CLI v4.2.0

yuth avatar Nov 27 '19 18:11 yuth

Just make sure to run amplify plugin scan, after you install version 4.2.0

oahmaro avatar Nov 27 '19 19:11 oahmaro

I still have this issue.

exspider64 avatar Nov 03 '20 02:11 exspider64

I have 4.24.2 installed

exspider64 avatar Nov 03 '20 02:11 exspider64

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

github-actions[bot] avatar May 25 '21 16:05 github-actions[bot]