Joe*_*son 2 node.js forever sails.js
我有一个SailsJS应用程序,其中很多是用CoffeeScript编写的。使用“风帆”在Prod模式下运行时,一切都很好。
永远运行它是行不通的。如果我检查日志,则问题似乎出在运行app.js的节点上
/var/www/obelix/api/models/Catalogue.coffee:2属性:^语法错误:意外令牌:位于Object.Module._extensions..js(module.js)的Module._compile(module.js:439:25) :474:10)在Module.load(module.js:356:32)在Function.Module._load(module.js:312:12)在Module.require(module.js:364:17)在require(模块.js:380:17)在/var/www/obelix/node_modules/sails/node_modules/include-all/index.js:96:53在Array.forEach(本机)在requireAll(/ var / www / obelix / node_modules /sails/node_modules/include->all/index.js:40:9)在buildDictionary>(/ var / www / obelix / node_modules / sails / lib / moduleloader / index.js:60:36)
是否有可能使Sails + Coffeescript应用程序使用节点/永远运行?
问题在于,除非您使用,否则咖啡脚本支持不起作用sails lift。尝试在app.js文件中要求coffee-script:
// Start sails and pass it command line arguments
require('coffee-script');
require('sails').lift(require('optimist').argv);
Run Code Online (Sandbox Code Playgroud)
然后 npm install coffee-script --save
| 归档时间: |
|
| 查看次数: |
2019 次 |
| 最近记录: |