Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PM2 Start Appname Returning Error Cannot Find Modules in Ubuntu 16

this is my first time using node js, and i found a complicated problem, i was thinking this issue because of yarn, so i've removed yarn package but still got the error in my log when i run sudo pm2 start myAppName

this is message i've got :

0|myAppName |     at tryModuleLoad (module.js:505:12)
0|myAppName |     at Function.Module._load (module.js:497:3)
0|myAppName |     at Function.Module.runMain (module.js:693:10)
0|myAppName |     at startup (bootstrap_node.js:191:16)
0|myAppName | Error: Cannot find module '/var/www/html/myAppName'
0|myAppName |     at Function.Module._resolveFilename 
(module.js:547:15)
0|myAppName |     at Function.Module._load (module.js:474:25)
0|myAppName |     at Object.<anonymous> 
(/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:75:21)
0|myAppName |     at Module._compile (module.js:652:30)
0|myAppName |     at Object.Module._extensions..js (module.js:663:10)
0|myAppName |     at Module.load (module.js:565:32)
0|myAppName |     at tryModuleLoad (module.js:505:12)
0|myAppName |     at Function.Module._load (module.js:497:3)
0|myAppName |     at Function.Module.runMain (module.js:693:10)
0|myAppName |     at startup (bootstrap_node.js:191:16)

the libraries and etc i believe is already installed in node_modules,

maybe you guys have a solution for my problem, should i use another command like pm2 ? or another else ?

please help, i will be appreciated

thanks anyway :)

like image 744
Muhammad Bima Pramadinata Avatar asked Nov 07 '22 03:11

Muhammad Bima Pramadinata


1 Answers

now i get it, the problem is not about the path, in my case, i just execute command sudo pm2 update, and the error log in pm2 was gone.

thanks

like image 190
Muhammad Bima Pramadinata Avatar answered Nov 09 '22 17:11

Muhammad Bima Pramadinata