简体   繁体   中英

Foundation 6 Zurb Template will not work offline

I installed Foundation 6 Zurb Template via the cli with no issues. I added the missing babel install. Works fine when online. I know BrowserSync works offline but it will not.

I get Async Completion prompt after when initiating watch. I have read that adding "online:true" to BrowserSync may fix this but I dont know where to add it to in Foundation 6's gulpfile.babel.js file. New to this...

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

Help is appreciated! Tnx!

I get this error when trying offline:

[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: foundation-zurb-template@1.0.0 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>

Check if port 8000 is free and not used by any other program? Use netstat to list what programs are listening on what ports or try to use some other port.

netsat -anb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM