2

How can I configure Heroku to have the flag --experimental-modules supplied to the Node.js executable to ensure I can use native modules in my JavaScript?

1 Answer 1

2

I also had this problem and solved it by adding a start script in the package.json file of my application as below:

"scripts": {
    …

    "start": "node --experimental-modules index.mjs ",

    …
}

For more details, see the topic "Specifying a start script" in Specifying a start script.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.