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

Getting error after updating amplify cli from 3.17.0 to 4.1.1

Open tgjorgoski opened this issue 7 years ago • 6 comments

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)

tgjorgoski avatar Nov 27 '19 09:11 tgjorgoski

I tried to do amplify env pull --restore, and getting the same error.

tgjorgoski avatar Nov 27 '19 09:11 tgjorgoski

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

tgjorgoski avatar Nov 27 '19 09:11 tgjorgoski

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

haebin-seong avatar Nov 27 '19 12:11 haebin-seong

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.

yuth avatar Nov 27 '19 15:11 yuth

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

yuth avatar Nov 27 '19 18:11 yuth

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.

github-actions[bot] avatar May 26 '21 13:05 github-actions[bot]