Luis Garcia
Luis Garcia

Reputation: 77

why do I get this error when I try to run amplify push or pull often?

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

Answers (2)

jon without an h
jon without an h

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

jangot
jangot

Reputation: 21

I think it happens because fs has no InternalModuleReadJSON

Upvotes: 0

Related Questions