2017-04-18 100 views
1

我对nodeJs完全陌生。我使用 node 5.0.0克隆了repo并推出了命令:无法启动节点应用配置文件

node ./app.js -c config.yaml 

,但我得到这个错误

node_modules/q/q.js:155 
       throw e; 
      ^

SyntaxError: Unexpected token u 
    at Object.parse (native) 
    at yaml2json (/home/../mosaic-techonmap-server/source/config.access.js:13:21) 
    at module.exports (/home/../mosaic-techonmap-server/source/config.access.js:152:23) 
    at /home/../app.js:89:45 
    at _fulfilled (/home/../node_modules/q/q.js:854:54) 
    at self.promiseDispatch.done (/home/../mosaic-techonmap-server/node_modules/q/q.js:883:30) 
    at Promise.promise.promiseDispatch (/home/../mosaic-techonmap-server/node_modules/q/q.js:816:13) 
    at /home/../mosaic-techonmap-server/node_modules/q/q.js:877:14 
    at runSingle (/home/../mosaic-techonmap-server/node_modules/q/q.js:137:13) 
    at flush (/home/../mosaic-techonmap-server/node_modules/q/q.js:125:13) 

有人有想法?

编辑:这里的config.yaml文件

--- 
# Configuration sample file for Jingo (YAML) 
application: 
    title: "CartoWiki" 
server: 
    hostname: "localhost" 
    port: 6067 
    localOnly: false 
    baseUrl: "http://localhost:6067" 
authentication: 
    google: 
     enabled: true 
    twitter: 
     enabled: true 
     oauthkeys: 
     consumerKey : '' 
     consumerSecret : '' 
     cacheExpire: 3600000 
    facebook: 
     enabled: true 
     oauthkeys: 
     clientID : '' 
     clientSecret : '' 
    alone: 
     enabled: false 
     username: "" 
     passwordHash: "" 
     email: "" 
twitterClient: 
    consumerKey : '' 
    consumerSecret : '' 
    accessTokenKey : '' 
    accessTokenSecret : '' 
+0

你之前运行过'npm install'吗? –

+0

你不能在作者的github上创建一个问题吗? – evolutionxbox

+0

发布'config.yaml'代码也 –

回答

0

我克隆回购的代码,当我想你的config.yaml我能够重现该问题。

config.access.js:152:23它节选config.accessRules但你的YAML文件没有accessRules所以accessRules对象变得由于错误Unexpected token u

未定义添加accessRules到你的配置,那么你不应该得到这个错误。