首页 > 解决方案 > 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)

标签: node.jspassenger

解决方案


推荐阅读