简体   繁体   English

为什么我的节点应用程序无法在 ec2 实例上的 amazon linux 2 AMI 上启动并显示此错误?

[英]why my node app don't start on amazon linux 2 AMI on ec2 instance and showing this error?

I have transferred all my files correctly to my ec2 instance and all the node modules are downloaded successfully with package.json file, the OS of my ec2 instance is Amazon linux 2, but whenever i run npm start on the terminal i get the following error. I have transferred all my files correctly to my ec2 instance and all the node modules are downloaded successfully with package.json file, the OS of my ec2 instance is Amazon linux 2, but whenever i run npm start on the terminal i get the following error . I have searched this alot and followed many similar or same issues on the web, but still can't figure it out.我已经搜索了很多,并在 web 上关注了许多类似或相同的问题,但仍然无法弄清楚。

the terminal says:-终端说:-

[ec2-user@ip-172-31-7-38 backbenchers]$ npm start

> learners-backend@1.0.0 start
> nodemon app.js

[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node app.js`
the-backbenchers.herokuapp.com
 undefined
 0.0.0.0
/home/ec2-user/backbenchers/node_modules/bindings/bindings.js:135
  throw err;
  ^

Error: Could not locate the bindings file. Tried:
 → /home/ec2-user/backbenchers/node_modules/deasync/build/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/build/Debug/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/build/Release/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/out/Debug/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/Debug/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/out/Release/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/Release/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/build/default/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/compiled/15.3.0/linux/x64/de                                                                                                             async.node
 → /home/ec2-user/backbenchers/node_modules/deasync/addon-build/release/install-                                                                                                             root/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/addon-build/debug/install-ro                                                                                                             ot/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/addon-build/default/install-                                                                                                             root/deasync.node
 → /home/ec2-user/backbenchers/node_modules/deasync/lib/binding/node-v88-linux-x                                                                                                             64/deasync.node
    at bindings (/home/ec2-user/backbenchers/node_modules/bindings/bindings.js:1                                                                                                             26:9)
    at Object.<anonymous> (/home/ec2-user/backbenchers/node_modules/deasync/inde                                                                                                             x.js:30:31)
    at Module._compile (node:internal/modules/cjs/loader:1102:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
    at Module.load (node:internal/modules/cjs/loader:967:32)
    at Function.Module._load (node:internal/modules/cjs/loader:807:14)
    at Module.require (node:internal/modules/cjs/loader:991:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/home/ec2-user/backbenchers/node_modules/locus/src/lo                                                                                                             cus.js:6:12)
    at Module._compile (node:internal/modules/cjs/loader:1102:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
    at Module.load (node:internal/modules/cjs/loader:967:32)
    at Function.Module._load (node:internal/modules/cjs/loader:807:14)
    at Module.require (node:internal/modules/cjs/loader:991:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/home/ec2-user/backbenchers/routes/posts.js:14:13) {
  tries: [
    '/home/ec2-user/backbenchers/node_modules/deasync/build/deasync.node',
    '/home/ec2-user/backbenchers/node_modules/deasync/build/Debug/deasync.node',
    '/home/ec2-user/backbenchers/node_modules/deasync/build/Release/deasync.node                                                                                                             ',
    '/home/ec2-user/backbenchers/node_modules/deasync/out/Debug/deasync.node',
    '/home/ec2-user/backbenchers/node_modules/deasync/Debug/deasync.node',
    '/home/ec2-user/backbenchers/node_modules/deasync/out/Release/deasync.node',
    '/home/ec2-user/backbenchers/node_modules/deasync/Release/deasync.node',
    '/home/ec2-user/backbenchers/node_modules/deasync/build/default/deasync.node                                                                                                             ',
    '/home/ec2-user/backbenchers/node_modules/deasync/compiled/15.3.0/linux/x64/                                                                                                             deasync.node',
    '/home/ec2-user/backbenchers/node_modules/deasync/addon-build/release/instal                                                                                                             l-root/deasync.node',
    '/home/ec2-user/backbenchers/node_modules/deasync/addon-build/debug/install-                                                                                                             root/deasync.node',
    '/home/ec2-user/backbenchers/node_modules/deasync/addon-build/default/instal                                                                                                             l-root/deasync.node',
    '/home/ec2-user/backbenchers/node_modules/deasync/lib/binding/node-v88-linux                                                                                                             -x64/deasync.node'
  ]
}
[nodemon] app crashed - waiting for file changes before starting...

node version is v15.3.0节点版本为 v15.3.0

npm version is v7.0.14 npm版本为v7.0.14

nvm version is 0.34.0 nvm 版本为 0.34.0

Kindly help me with this situation.请帮助我解决这种情况。

I downgraded the node version to 12.0.0.我将节点版本降级为 12.0.0。 Now it is working fine现在它工作正常

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM