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

npm install -g @aws-amplify/cli give error

Open cmrlabs opened this issue 7 years ago • 34 comments

Check the below command response

Command used : npm install -g @aws-amplify/cli

Response :

Chandras-MacBook-Pro:~ chandramoulireddyporeddy$ npm install -g @aws-amplify/cli
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated [email protected]: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/Users/chandramoulireddyporeddy/.npm-global/bin/amplify -> /Users/chandramoulireddyporeddy/.npm-global/lib/node_modules/@aws-amplify/cli/bin/amplify
npm WARN [email protected] requires a peer of graphql@^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.

+ @aws-amplify/[email protected]
updated 3 packages in 96.79s

Chandras-MacBook-Pro:~ chandramoulireddyporeddy$ amplify configure
-bash: amplify: command not found
Chandras-MacBook-Pro:~ chandramoulireddyporeddy$ 

I hope you understand the above issue.

cmrlabs avatar Jan 27 '19 20:01 cmrlabs

@cmrlabs Looks like the CLI was installed but with warnings (which are currently expected due to our dependencies). I tried to install the CLI and use the amplify command and wasn't able to reproduce it. Let me investigate on this.

kaustavghosh06 avatar Jan 28 '19 18:01 kaustavghosh06

try npm list -g --depth=0, does @aws-amplify/cli appear in that list? If not, your path is not configured correctly.

slaat avatar Jan 28 '19 21:01 slaat

I tried, path configured correctly

Chandras-MacBook-Pro:~ chandramoulireddyporeddy$ npm list -g --depth=0
/Users/chandramoulireddyporeddy/.npm-global/lib
├── @aws-amplify/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

npm ERR! peer dep missing: graphql@^0.11.0 || ^0.12.0 || ^0.13.0, required by [email protected]
Chandras-MacBook-Pro:~ chandramoulireddyporeddy$ 


cmrlabs avatar Jan 29 '19 01:01 cmrlabs

Same issue, this is running from a docker container of image node:10.15.0.

shazzner avatar Feb 01 '19 20:02 shazzner

Haggenmacher-MBP:~ swan$ npm list -g --depth=0
/Users/swan/.nvm/versions/node/v11.9.0/lib
├── @aws-amplify/[email protected]
└── [email protected]

npm ERR! peer dep missing: graphql@^0.11.0 || ^0.12.0 || ^0.13.0, required by [email protected]

Same issue. Are we able to manually install these peer dependencies? If so, what are the steps? If not, can we install the CLI using another npm package like peerdeps (https://www.npmjs.com/package/install-peerdeps)?

haggenmacher avatar Feb 03 '19 03:02 haggenmacher

I have this issue, as well.

MacBook-Pro:~ jahnaariellegoldman$ npm list -g --depth=0
/Users/jahnaariellegoldman/.npm-global/lib
├── @aws-amplify/[email protected]
├── [email protected]
└── [email protected]

npm ERR! peer dep missing: graphql@^0.11.0 || ^0.12.0 || ^0.13.0, required by [email protected]

jahnagoldman avatar Feb 05 '19 06:02 jahnagoldman

Same issue on my mac as well.

Vishals-MacBook-Pro:Angular vishalshinde$ npm list -g --depth=0 /usr/local/lib +-- @angular/[email protected] +-- @aws-amplify/[email protected] +-- [email protected] `-- [email protected]

npm ERR! peer dep missing: graphql@^0.11.0 || ^0.12.0 || ^0.13.0, required by [email protected]

vishal2332 avatar Feb 07 '19 12:02 vishal2332

Same issue here.

Gabadon:Developer sirshannon$ npm list -g --depth=0
/Users/sirshannon/npm-global/lib
├── @aws-amplify/[email protected]
├── [email protected]
└── [email protected]

npm ERR! peer dep missing: graphql@^0.11.0 || ^0.12.0 || ^0.13.0, required by [email protected]

sirshannon avatar Feb 08 '19 20:02 sirshannon

I found that uninstalling node completely for me and using nvm to reinstall fixed the issue. I think it had something to do with having different versions of node installed.

jahnagoldman avatar Feb 08 '19 20:02 jahnagoldman

Hey guys, please take a look at @jahnagoldman solution and if you're still facing the issue, please let me know and we can re-open this issue.

kaustavghosh06 avatar Feb 20 '19 01:02 kaustavghosh06

A solution would be "uninstall node completely and use nvm to install node version [a specific node version here]."

Uninstalling node and installing the current version (which is the same version as before I uninstalled) results in the same error.

sirshannon avatar Feb 24 '19 01:02 sirshannon

not sure if this helps but here is the extremely simplified dependency graph showing the issue(s?):

├─┬ @aws-amplify/[email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ 
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected] deduped
│ │ │ 
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ 
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ UNMET PEER DEPENDENCY [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ 
│ │ ├─┬ [email protected]
│ │ │ 
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ 
│ ├─┬ [email protected]
│ │ ├── [email protected] deduped
│ │ │ 
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ 
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ 
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ 
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ 
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ 
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]

sirshannon avatar Feb 24 '19 18:02 sirshannon

Mentions of this issue as far back as November: #434

sirshannon avatar Feb 24 '19 19:02 sirshannon

@sirshannon Can you run echo $PATH and see if your bin directory where the amplify CLI is installed is included in it?

kaustavghosh06 avatar Feb 24 '19 21:02 kaustavghosh06

@kaustavghosh06 It is. /usr/local/bin is the first item in my PATH and which amplify reports /usr/local/bin/amplify

Amplify is found and usable on one of my machines in spite of the error. I have not attempted to use it on all of my machines but did get that error on each of them.

See also #434 for someone having the error but being able to use amplify as expected.

sirshannon avatar Feb 24 '19 22:02 sirshannon

@sirshannon, in #434, @bearc0025 refers to the npm warnings when installing the CLI, are you referring to the following as errors?

npm WARN [email protected] requires a peer of graphql@^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.

The original issue if you look at the top, refers to this:

Chandras-MacBook-Pro:~ chandramoulireddyporeddy$ amplify configure
-bash: amplify: command not found

In this case, the user is not able to execute the amplify commands after installing. Are you referring to the same issue?

kaustavghosh06 avatar Feb 24 '19 22:02 kaustavghosh06

@kaustavghosh06 Yes, that is a warning but if they were to list their npm modules after getting that warning, they would get the same error that everyone in this thread has posted.

npm ERR! peer dep missing: graphql@^0.11.0 || ^0.12.0 || ^0.13.0, required by [email protected]

I think it's been posted enough times by enough people to make it clear what we're talking about here.

sirshannon avatar Feb 24 '19 23:02 sirshannon

@sirshannon I'm just trying to help out here and trying to ask clarifying questions since the peer dep issue is not at all related to the original issue by @cmrlabs If your issue is tied to the warnings/errors on installation we're tracking it as a part of #783

kaustavghosh06 avatar Feb 24 '19 23:02 kaustavghosh06

@kaustavghosh06 okay, trying to clarify now: I had the same issue as the OP in this thread. Like the others in the thread, I had npm ERR! peer dep missing: graphql@^0.11.0 || ^0.12.0 || ^0.13.0, required by [email protected] after the warnings during amplify installation. I tried to correct the issue but was never able to install without the peer dependency warning/error. Because I was never able to install without getting the warning and error, I never attempted to run amplify again after that. I don't know if it worked or not.

Are you saying that the warnings and error re missing [email protected] peer dependencies doesn't matter and we should ignore it?

sirshannon avatar Feb 24 '19 23:02 sirshannon

any solution?

bestwade22 avatar Feb 28 '19 08:02 bestwade22