node.js - SyntaxError:在严格模式下使用 const。在 PhusionPassenger 服务器上
问题描述
我在服务器上上传了我的 node.js 应用程序,但出现以下错误。服务器运行 Ubuntu 14.04 。我已将服务器上的节点版本更新为 v10.9.0,但它仍然给我这个错误:
An error occurred while starting the web application. It exited before
signalling successful startup back to Phusion Passenger. Please read this
article for more information about this problem.
Raw process output:
/home/kevinshirley/tripimagine.com/node_modules/mongoose/lib/index.js:7
const Schema = require('./schema');
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous>
(/home/kevinshirley/tripimagine.com/node_modules/mongoose/index.js:7:18)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
解决方案
推荐阅读
- html - HTML 和 CSS 块 - 悬停时更改整个块的颜色
- python - 我正在尝试使用 Python3 在 Windows 中下载“robotframework-OracleLibrary-version 0.0.3-dev0”
- mysql - 如何在创建数据库语句中传递变量值?
- javascript - 从透明到实体导航栏
- c - 如果我在 printf 方法中将所有 %X 替换为 %p 怎么办
- c# - C# windows窗体异步任务获取跨线程操作异常
- django - 视图中的 TypeError:字段需要一个数字,但得到了 SimpleLazyObject
- php - 无效的登录详细信息 PDO PHP
- python - 如何在请求中使用分页
- laravel-backpack - JSVALIDATOR 用于 LARAVEL 背包