2014-07-08 76 views
-1

我是很新,流星正在此錯誤:意外標記錯誤

=> Errors prevented startup: 

While building the application: 
lib/packages/iron-router/examples/hooks/hooks.js:30:58: Unexpected token ; 

=> Your application has errors. Waiting for file change. 

它突然出現在添加Iron-Router到我的應用程序。該錯誤是指this file,特別是開始ready: promiseToReady行:

this.route('adminPage', { 
    path: '/admin', 

    // 10. 3rd party API calls that are similar to waitOns: 
    waitOn: function() { 
     return { 
     // this is made up but I do have code conceptually similar to this 
     ready: promiseToReady(GoogleApi.call('/foo/bar')); 
     } 
    } 
    }); 
+0

我認爲函數返回正在等待函數調用,而是它得到一個表達式。 – Izekid

回答

2

在Javascript中你終止對象PARAMS與,,不與;

錯誤:

return { 
    ready: promiseToReady(GoogleApi.call('/foo/bar')); 
    }; 

正確:

return { 
    ready: promiseToReady(GoogleApi.call('/foo/bar')), 
    }; 
0

看來一攬子計劃安裝不正確。我確保完全刪除它並重新安裝:

> mrt remove iron-router 
> meteor remove iron-router 
> mrt add iron-router 
> meteor add iron-router 
1

我也遇到了同樣的問題。使用mrt/meteor刪除鐵路由器,然後從軟件包文件夾中刪除所有與鐵路由器相關的目錄。

檢查您從哪裏運行mrt/meteor add命令的目錄路徑...確保您從項目根目錄運行該命令。從項目根目錄運行它解決了我的問題。早先我從項目的一個子文件夾運行命令。