Getting error after updating amplify cli from 3.17.0 to 4.1.1
Right after the update of amplify cli from 3.17.0 to 4.1.1 when I do amplify status I get the expected status report, but also after that I get the following:
Cannot find module 'strip-indent'
Require stack:
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/lib/languages/java-declaration-block.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/lib/visitors/appsync-java-visitor.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/lib/plugin.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/lib/index.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen/src/commands/models.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen/src/index.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/graphql-codegen.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/index.js
- /usr/local/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/show-helpful-provider-links.js
- /usr/local/lib/node_modules/@aws-amplify/cli/lib/domain/amplify-toolkit.js
- /usr/local/lib/node_modules/@aws-amplify/cli/lib/domain/context.js
- /usr/local/lib/node_modules/@aws-amplify/cli/lib/context-manager.js
- /usr/local/lib/node_modules/@aws-amplify/cli/lib/index.js
- /usr/local/lib/node_modules/@aws-amplify/cli/bin/amplify
/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/lib/languages/java-declaration-block.js:1
Error: Cannot find module 'strip-indent'
Require stack:
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/lib/languages/java-declaration-block.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/lib/visitors/appsync-java-visitor.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/lib/plugin.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/lib/index.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen/src/commands/models.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen/src/index.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/graphql-codegen.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js
- /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/index.js
- /usr/local/lib/node_modules/@aws-amplify/cli/lib/extensions/amplify-helpers/show-helpful-provider-links.js
- /usr/local/lib/node_modules/@aws-amplify/cli/lib/domain/amplify-toolkit.js
- /usr/local/lib/node_modules/@aws-amplify/cli/lib/domain/context.js
- /usr/local/lib/node_modules/@aws-amplify/cli/lib/context-manager.js
- /usr/local/lib/node_modules/@aws-amplify/cli/lib/index.js
- /usr/local/lib/node_modules/@aws-amplify/cli/bin/amplify
at Object.<anonymous> (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin/lib/languages/java-declaration-block.js:4:21)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
I tried to do amplify env pull --restore, and getting the same error.
OK, it seems there is a package missing,I went to : /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-codegen-appsync-model-plugin
included the strip-indent package in package.json , did npm install, and things started to work
Can't believe someone is in the EXACT same situation as me (including 3.17.0 -> 4.1.1), and that someone opened an issue 3 hours ago from the time when i checked github for this problem
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.
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
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.