0
Speak, devs!
Following...
I would like to know how to deploy a Nodejs application using ES6 Modules
In my package.json I am using so:
"type": "module",
...
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "nodemon --es-module-specifier-resolution=node src",
"start": "--es-module-specifier-resolution=node src"
},
For the nodemon to recognize the modules I had to add content --es-module-specifier-resolution=node
in dev
For PM2 reconhcer need to add node_ags node_args: "--es-module-specifier-resolution=node",
to be able to recognize the modules
Following in the footsteps of that document, I came across the command heroku local web
Where I execute the command I have the following return
'--es-module-specifier-resolution' n�o � reconhecido como um comando interno
But if I take the --es-module-specifier-resolution=node
start it does not recognize the modules
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
How do I add this node or make Heroku accept modules?
Is your start script correct? The word is not missing
node
ornodemon
before the arguments?– Danizavtz
What is the value of the property
type
in hispackage.json
?– Luiz Felipe
It must be the "start" that is wrong
– Guilherme Nascimento
@Luizfelipe the value of the type property is module
– adventistaam
@Guilhermenascimento as it is, is the start that I need to know the correct way how Heroku recognizes
– adventistaam
@Danizavtz Right! That’s right! Something was missing before the arguments.. It was Node
– adventistaam
Oops, blz. I voted to close because it was just a mistake, how nice that it was solved.
– Guilherme Nascimento
Blz! I’ve seen questions in the forum at Universities that are not answered
– adventistaam