Search code examples
node.jssassgulpzurb-foundation

Using Foundation-CLI / Gulp on Multiple Machines


I'm working on a project using foundation for sites across multiple computers. I've installed foundation via the command line app (version 2.1.0). My project folder is synced via dropbox and if I run "foundation build" or "foundation watch" on the original machine I created the project on, it works fine.

However, when I attempt to run "foundation watch" on my second computer (with the same versions of foundation-cli and gulp), I get this error. The only difference is one computer has node 5.7.0 and the other has 5.0.0. Everything else (foundation-cli, bower, gulp) are all running identical versions. Any ideas how I can resolve this? Thanks.

Here's the error:

> foundation-sites-template@1.0.0 start /Users/nick/Dropbox/Sync/Web Site/www/wp-content/themes/foundation 
> gulp 
module.js:339 
throw err; 
^ 
Error: Cannot find module '../lib/completion' 
at Function.Module._resolveFilename (module.js:337:15) 
at Function.Module._load (module.js:287:25) 
at Module.require (module.js:366:17) 
at require (module.js:385:17) 
at Object. (/Users/nick/Dropbox/Sync/Web Site/www/wp-
content/themes/foundation/node_modules/.bin/gulp:13:18) 
at Module._compile (module.js:425:26) 
at Object.Module._extensions..js (module.js:432:10) 
at Module.load (module.js:356:32) 
at Function.Module._load (module.js:311:12) 
at Function.Module.runMain (module.js:457:10) 
Error: foundation-sites-template@1.0.0 start: `gulp` 
Exit status 1 
at EventEmitter. (/usr/local/lib/node_modules/foundation-
cli/node_modules/npm/lib/utils/lifecycle.js:214:16) 
at emitTwo (events.js:87:13) 
at EventEmitter.emit (events.js:172:7) 
at ChildProcess. (/usr/local/lib/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:818:16) 
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

EDIT: I've updated to node 5.7.0 on my other computer, so the versions are the same everywhere.


Solution

  • It turns out I can use it on multiple computers. You just have to delete the node_modules folder (e.g., rm -r node_modules), then when you want to use on the other machine do npm install to get the node modules back for that environment. This is slightly annoying because there are so many files to sync when doing this over Dropbox or NextCloud.