Amplify-cli: "Choose the type of app you're building" empty when installed locally

Created on 22 Apr 2020  路  5Comments  路  Source: aws-amplify/amplify-cli

Describe the bug
In order to ensure that all builders (developers and CI/CD environments) use the same version of build toolchains, a common pattern is to include build/test requirements under devDependencies in the project's package.json rather than relying on a global installation of the tool and execute it via e.g. $(npm bin)/amplify. Attempting to do this with the amplify CLI results in the init prompt Choose the type of app you're building having no options and crashing.

Amplify CLI Version
$(npm bin)/amplify -v gives 4.18.0

To Reproduce
In an empty folder, npm install --save-dev @aws-amplify/cli && $(npm bin)/amplify init. Fill out the prompts until you get to Choose the type of app you're building - no entries are listed, and attempting to accept the default causes a Cannot read property 'value' of undefined error.

Expected behavior
The same behavior as a globally-installed version (in my case, presenting the options android, ios, and javascript).

Desktop (please complete the following information):

  • OS: Debian 9 on WSL on Windows Server 2019 v1809
  • Node Version: 13.13.0

Additional context
after running rm -r * && npm install --save-dev @aws-amplify/cli, my package-lock.json is as attached (uploaded as txt because github doesn't allow attaching json files to issues):
package-lock.json.txt

enhancement pending-review platform

Most helpful comment

Currently the CLI does not support local install. We do have a pr in the works for this.
https://github.com/aws-amplify/amplify-cli/pull/3857

All 5 comments

Currently the CLI does not support local install. We do have a pr in the works for this.
https://github.com/aws-amplify/amplify-cli/pull/3857

@SwaySway #3857 was approved but then closed saying it's been backlogged. Any updates on this issue?

I have this issue when developing with vue 3.

I would also really appreciate being able to install the Amplify CLI locally. When installing globally on CI it can take 15-20 minutes just for this global install alone.

It's not even possible to cache. You can't use npm ci globally, which is the only method available for npm package caching on gitlab. There's no access to the root cache in Gitlab CI.

And as others have said, really we should be pinning the version down for a given project.

Try building a docker container and using it as a replacement for a virtual environment until local install is supported.

Was this page helpful?
0 / 5 - 0 ratings