2016-05-13 124 views
0

我通過cli安裝Foundation 6 Zurb模板沒有問題。 我添加了缺少的babel安裝。在線時正常工作。我知道BrowserSync離線工作,但不會。基金會6 Zurb模板不會脫機工作

啓動手錶後,我會得到Async Completion提示。我已經讀過,向BrowserSync添加「online:true」可能會解決這個問題,但我不知道將它添加到Foundation 6的gulpfile.babel.js文件中。對此新...

//Start a server with BrowserSync to preview the site in 
function server(done) { 
browser.init({ 
    server:PATHS.dist,port:PORT 
}); 
done(); 
} 

幫助表示讚賞! TNX!

試圖下線時,我得到這個錯誤:

[07:17:10] Requiring external module babel-register 
[07:18:35] Using gulpfile ~\Desktop\SMO Docs\smoProject\gulpfile.babel.js 
[07:18:35] Starting 'default'... 
[07:18:35] Starting 'build'... 
[07:18:35] Starting 'clean'... 
[07:18:35] Finished 'clean' after 50 ms 
[07:18:35] Starting 'pages'... 
[07:18:35] Starting 'sass'... 
[07:18:35] Starting 'javascript'... 
[07:18:35] Starting 'images'... 
[07:18:35] Starting 'copy'... 
[07:19:48] Finished 'images' after 1.22 min 
[07:19:55] Finished 'pages' after 1.33 min 
[07:19:55] Finished 'sass' after 1.33 min 
[07:19:56] Finished 'copy' after 1.33 min 
[07:20:03] Finished 'javascript' after 1.45 min 
[07:20:03] Starting 'styleGuide'... 
[07:20:03] Finished 'styleGuide' after 180 ms 
[07:20:03] Finished 'build' after 1.47 min 
[07:20:03] Starting 'server'... 
[07:20:04] Finished 'server' after 1.01 s 
[07:20:04] Starting 'watch'... 
[07:22:18] The following tasks did not complete: default, watch 
[07:22:18] Did you forget to signal async completion? 
events.js:141 
     throw er; // Unhandled 'error' event 
    ^
Error: listen EACCES 0.0.0.0:8000 
    at Object.exports._errnoException (util.js:870:11) 
    at exports._exceptionWithHostPort (util.js:893:20) 
    at Server._listen2 (net.js:1223:19) 
    at listen (net.js:1272:10) 
    at Server.listen (net.js:1368:5) 
    at module.exports.plugin (C:\Users\Ryan\Desktop\SMO Docs\smoProject\node_modules\browser-sync\lib\server\index.js:24:25) 
    at Object.module.exports.startServer [as fn] (C:\Users\Ryan\Desktop\SMO Docs 
\smoProject\node_modules\browser-sync\lib\async.js:230:52) 
    at C:\Users\Ryan\Desktop\SMO Docs\smoProject\node_modules\browser-sync\lib\b 
rowser-sync.js:149:14 
    at iterate (C:\Users\Ryan\Desktop\SMO Docs\smoProject\node_modules\browser-s 
ync\lib\utils.js:268:13) 
    at C:\Users\Ryan\Desktop\SMO Docs\smoProject\node_modules\browser-sync\lib\u 
tils.js:277:25 
    at executeTask (C:\Users\Ryan\Desktop\SMO Docs\smoProject\node_modules\brows 
er-sync\lib\browser-sync.js:170:13) 
    at Object.module.exports.setRewriteRules [as fn] (C:\Users\Ryan\Desktop\SMO 
Docs\smoProject\node_modules\browser-sync\lib\async.js:209:9) 
    at C:\Users\Ryan\Desktop\SMO Docs\smoProject\node_modules\browser-sync\lib\b 
rowser-sync.js:149:14 
    at iterate (C:\Users\Ryan\Desktop\SMO Docs\smoProject\node_modules\browser-sync\lib\utils.js:268:13) 
    at C:\Users\Ryan\Desktop\SMO Docs\smoProject\node_modules\browser-sync\lib\utils.js:277:25 
    at executeTask (C:\Users\Ryan\Desktop\SMO Docs\smoProject\node_modules\browser-sync\lib\browser-sync.js:170:13) 
Error: [email protected] start: `gulp` 
Exit status 1 
    at EventEmitter.<anonymous> (C:\Users\Ryan\AppData\Roaming\npm\node_modules\ 
foundation-cli\node_modules\npm\lib\utils\lifecycle.js:217:16) 
    at emitTwo (events.js:87:13) 
    at EventEmitter.emit (events.js:172:7) 
    at ChildProcess.<anonymous> (C:\Users\Ryan\AppData\Roaming\npm\node_modules\foundation-cli\node_modules\npm\lib\utils\spawn.js:24:14) 
    at emitTwo (events.js:87:13) 
    at ChildProcess.emit (events.js:172:7) 
    at maybeClose (internal/child_process.js:821:16) 
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)C:\Users\Ryan\Desktop\SMO Docs\smoProject> 

回答

0

檢查端口8000是免費的,沒有被任何其他程序?使用netstat來列出哪些程序正在偵聽哪些端口或嘗試使用某個其他端口。

netsat -anb 
+0

謝謝。 gulp文件中的端口設置爲8000,但它在8080上打開(出於某種原因?)。我檢查了netsat,沒有任何一個端口。我將gulp文件中的端口更改爲8001,現在它可以工作。 任何想法在Foundation 6 BrowserSync中何處/如何進入'online:true'? TNX! – RCD