On executing
npm install -g @aws-amplify/cli
It results in
npm ERR! Maximum call stack
I figured out an answer to the problem, which probably lies with Nodejs version 12.16 and many other earlier versions like 5.0 and 10; But using version 13.13 solved the problem and the command run with no issues.
Using the following command worked for me
npm cache clean --force
For me the log looked like this:
// ... skipping some deprecation warnings
> core-js@3.6.5 postinstall /root/.nvm/versions/node/v14.10.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-graphql-types-generator/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
sh: 1: node: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/@aws-amplify/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-09-10T14_10_28_397Z-debug.log
Note sh: 1: node: Permission denied
that led me to https://forum.vuejs.org/t/cannot-install-vue-cli-permission-error-in-require-postinstall/82017/7
I had to add --unsafe-perm
to the install command and run it as root (I was already root in WSL):
npm install -g --unsafe-perm @aws-amplify/cli