为什么我的节点应用程序没有在 ec2 实例上的 amazon linux 2 AMI 上启动并显示此错误? [英] why my node app don't start on amazon linux 2 AMI on ec2 instance and showing this error?

查看:26
本文介绍了为什么我的节点应用程序没有在 ec2 实例上的 amazon linux 2 AMI 上启动并显示此错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将所有文件正确传输到我的 ec2 实例,并且所有节点模块都已使用 package.json 文件成功下载,我的 ec2 实例的操作系统是 Amazon linux 2,但是每当我在终端上运行 npm start 时,我都会得到以下错误.我已经搜索了很多,并在网上关注了许多类似或相同的问题,但仍然无法弄清楚.

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.

终端说:-

[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...

节点版本为 v15.3.0

node version is v15.3.0

npm 版本是 v7.0.14

npm version is v7.0.14

nvm 版本为 0.34.0

nvm version is 0.34.0

请帮助我解决这种情况.

Kindly help me with this situation.

推荐答案

我将节点版本降级到 12.0.0 .现在一切正常

I downgraded the node version to 12.0.0 . Now it is working fine

这篇关于为什么我的节点应用程序没有在 ec2 实例上的 amazon linux 2 AMI 上启动并显示此错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆