Reputation: 77
this the error
const internalModuleReadJSON = function (f) { return require('fs').internalModuleReadJSON(f); };
^
TypeError: require(...).internalModuleReadJSON is not a function
this error fixes itself randomly, sometimes it works, sometimes not,
sometimes I have to delete my project and then restart my pc but sometimes it works sometimes it doesn't
how can I fix this error?
Upvotes: 1
Views: 347
Reputation: 592
Check the value of your NODE_OPTIONS
variable before running amplify
- some tools (e.g. VS Code) may be setting this to a value that conflicts with something Amplify is doing.
If so, you can quickly (if clumsily) work around it by always running Amplify as NODE_OPTIONS= amplify [push|pull|whatever]
.
See https://github.com/aws-amplify/amplify-cli/issues/10284
Upvotes: 4