question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error during `amplify init` process, unable to init a project

See original GitHub issue

Describe the bug

Unable to init a project.

To Reproduce Steps to reproduce the behavior:

  1. Go into an existing TypeScript project
  2. run npm install @aws-amplify/cli
  3. run ./node_modules/.bin/amplify init
  4. answer questions.
  5. When it gets to question Choose the type of that you're building (Use arrow keys), it shows no options. Pressing arrow keys does nothing (because there’s no options).
  6. Pressing enter causes an error as follows:
❯ ./node_modules/.bin/amplify init
Note: It is recommended to run this command from the root of your app directory
? Enter a name for the project test
? Choose your default editor: Atom Editor
? Choose the type of app that you're building

/Users/trusktr/src/Signafy+mapper-annotated-scene/node_modules/gluegun/build/index.js:13
    throw up;
    ^

TypeError: Cannot read property 'value' of undefined
    at ListPrompt.getCurrentValue (/Users/trusktr/src/Signafy+mapper-annotated-scene/node_modules/@aws-amplify/cli/node_modules/inquirer/lib/prompts/list.js:121:53)
    at MapSubscriber._next (/Users/trusktr/src/Signafy+mapper-annotated-scene/node_modules/rxjs/internal/operators/map.js:49:35)
    at MapSubscriber.Subscriber.next (/Users/trusktr/src/Signafy+mapper-annotated-scene/node_modules/rxjs/internal/Subscriber.js:67:18)
    at TakeSubscriber._next (/Users/trusktr/src/Signafy+mapper-annotated-scene/node_modules/rxjs/internal/operators/take.js:54:30)
    at TakeSubscriber.Subscriber.next (/Users/trusktr/src/Signafy+mapper-annotated-scene/node_modules/rxjs/internal/Subscriber.js:67:18)
    at Interface.handler (/Users/trusktr/src/Signafy+mapper-annotated-scene/node_modules/rxjs/internal/observable/fromEvent.js:22:28)
    at Interface.emit (events.js:187:15)
    at Interface._onLine (readline.js:290:10)
    at Interface._line (readline.js:638:8)
    at Interface._ttyWrite (readline.js:919:14)

Here’s what it looks like right when I get to the third prompt, before I press any arrow keys:

Signafy+mapper-annotated-scene git:feature/annotation-labels ❯ ./node_modules/.bin/amplify init
Note: It is recommended to run this command from the root of your app directory
? Enter a name for the project test
? Choose your default editor: Atom Editor
? Choose the type of app that you're building (Use arrow keys)

and there’s no options visible under that third prompt.

Expected behavior

To get through init process

Screenshots

screen shot 2019-01-03 at 1 46 24 pm

Desktop (please complete the following information):

  • OS: macOS Mojave
  • Version:
❯ cat node_modules/@aws-amplify/cli/package.json | grep version
  "version": "0.1.38"

Smartphone (please complete the following information):

N/A

Additional context

Let me know if you need any

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
melwinpaiscommented, Nov 20, 2019

Team,

I have a related issue: ./node_modules/.bin/amplify init doesnt behave like amplify init I need to execute it off project folder so that I can use it in CI/CD pipeline.

Let me know if there is a fix/workaround.

instance:my-amply-app paism$ ./node_modules/.bin/amplify init --amplify '{"projectName":"connect-console","envName":"yarra","defaultEditor":"code"}' --frontend '{"frontend":"javascript","framework":"react","config":{"SourceDir":"src","DistributionDir":"build","BuildCommand":"npm run-script build","StartCommand":"npm run-script start"}}' --providers '{"awscloudformation":{"configLevel":"project","useProfile":true,"profileName":"test","region":"ap-southeast-2"}}' --yes
Scanning for plugins...
Plugin scan successful
Note: It is recommended to run this command from the root of your app directory
Using default provider  undefined
init failed
TypeError [ERR_INVALID_ARG_TYPE]: The 'request' argument must be string. Received type undefined
    at /Users/paism/ws/tab/my-amply-app/node_modules/@aws-amplify/cli/lib/lib/init-steps/s2-initProviders.js:55:46
    at Array.forEach (<anonymous>)
    at /Users/paism/ws/tab/my-amply-app/node_modules/@aws-amplify/cli/lib/lib/init-steps/s2-initProviders.js:54:31
    at step (/Users/paism/ws/tab/my-amply-app/node_modules/@aws-amplify/cli/lib/lib/init-steps/s2-initProviders.js:33:23)
    at Object.next (/Users/paism/ws/tab/my-amply-app/node_modules/@aws-amplify/cli/lib/lib/init-steps/s2-initProviders.js:14:53)
    at fulfilled (/Users/paism/ws/tab/my-amply-app/node_modules/@aws-amplify/cli/lib/lib/init-steps/s2-initProviders.js:5:58)



instance:my-amply-app paism$ amplify init --amplify '{"projectName":"connect-console","envName":"yarra","defaultEditor":"code"}' --frontend '{"frontend":"javascript","framework":"react","config":{"SourceDir":"src","DistributionDir":"build","BuildCommand":"npm run-script build","StartCommand":"npm run-script start"}}' --providers '{"awscloudformation":{"configLevel":"project","useProfile":true,"profileName":"test","region":"ap-southeast-2"}}' --yes
Scanning for plugins...
Plugin scan successful
Note: It is recommended to run this command from the root of your app directory

For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
... WORKS FINE ...

0reactions
github-actions[bot]commented, May 26, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get started - Typical workflows - AWS Amplify Docs
The init command goes through the following steps: Analyzes the project and confirms the frontend settings; Carries out the initialization logic of the ......
Read more >
AWS Amplify, init failed - flutter - Stack Overflow
I'm trying to integrate AWS Amplify to my flutter project but having this issue while trying to run the amplify init command init...
Read more >
Team workflows with Amplify backend environments
Create prod, test, and dev backend environments with the Amplify CLI. ... Install the Amplify CLI to initialize a new Amplify project.
Read more >
Quickstart
The init process. $ amplify init. The init command must be executed at the root directory of a project to initialize the project...
Read more >
AWS Amplify - There was an error initializing your environment
So, the time has come to pull your amplify project down to another development machine and you've run into the dreaded "There was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found