I am very new to Node.js
and I tried to run a project (made by other developer) by having a command in terminal node app.js
. But I encountered below error, do you have any idea how to run this project?
I followed few instructions here to run a project.
Error logs below:
Junryls-Mac-mini:app junrylmaraviles$ node app.js /Users/junrylmaraviles/Desktop/myfolder/mysubfolder/app/app.js:1 (function (exports, require, module, __filename, __dirname) { define('src/app' ^ ReferenceError: define is not defined at Object.<anonymous> (/Users/junrylmaraviles/Desktop/myfolder/mysubfolder/app/app.js:1:63) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:902:3
Node. js can run shell commands by using the standard child_process module. If we use the exec() function, our command will run and its output will be available to us in a callback. If we use the spawn() module, its output will be available via event listeners.
Assuming I have node and npm properly installed on the machine, I would
use nodemon app.js ( nodemon is a utility that will monitor for any changes in your source and automatically restart your server)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With