此错误是否意味着找不到节点模块?



我想当我缺少模块时,我已经在本地计算机上看到了此错误,但我正在尝试使用 pm2 启动我的代码。这就是这里看到的错误吗?

0|my-ba |     at Object.<anonymous> (/home/user/website/index.js:4:1)
0|my-ba |     at Module._compile (internal/modules/cjs/loader.js:1133:30)
0|my-ba |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
0|my-ba |     at Module.load (internal/modules/cjs/loader.js:977:32)
0|my-ba |     at Function.Module._load (internal/modules/cjs/loader.js:877:14)
0|my-ba |     at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:32:23)
0|my-ba |     at Module._compile (internal/modules/cjs/loader.js:1133:30)
0|my-ba |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
0|my-ba |     at Module.load (internal/modules/cjs/loader.js:977:32)
0|my-ba |     at Function.Module._load (internal/modules/cjs/loader.js:877:14)
0|my-ba |     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
0|my-ba |     at internal/main/run_main_module.js:18:47 {
0|my-ba |   code: 'MODULE_NOT_FOUND',
0|my-ba |   requireStack: [ '/home/user/website/index.js' ]
0|my-ba | }

它说它不知道如何"启动"你的应用程序,因为它不在主页/用户/网站/索引中.js

您需要编辑您的package.json,看看哪个是启动命令并相应地移动文件(或编辑,以更方便的方式为准(

最新更新