node.js - 在多台机器上使用 Foundation-CLI/Gulp

标签 node.js sass gulp zurb-foundation

我正在开发一个项目,使用跨多台计算机的站点基础。我已经通过命令行应用程序安装了基础(版本2.1.0)。我的项目文件夹是通过 dropbox 同步的,如果我在创建项目的原始计算机上运行“foundation build”或“foundation watch”,它就可以正常工作。

但是,当我尝试在第二台计算机上运行“foundation watch”(具有相同版本的foundation-cli 和 gulp)时,出现此错误。唯一的区别是一台计算机的 Node 为 5.7.0,另一台计算机的 Node 为 5.0.0。其他所有东西(foundation-cli、bower、gulp)都运行相同的版本。我有什么想法可以解决这个问题吗?谢谢。

错误如下:

> 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)

编辑:我已在另一台计算机上更新到 Node 5.7.0,因此各地版本都是相同的。

最佳答案

这看起来像是 gulp 包的问题。我遇到了同样的错误(尽管没有使用基础),并在“npm 缓存清理”为我修复后重新安装 gulp,你没有提到已经尝试过。

关于node.js - 在多台机器上使用 Foundation-CLI/Gulp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35637974/

相关文章:

firefox - Browsersync - 如何选择要运行的浏览器安装?

javascript - Gulp + JS 库 + JSON 数据

javascript - 使用 pug 文件在 html 中显示 JS 文件中的变量

javascript - html5 岩石 Node js 服务器发送事件 SSE 示例不工作

javascript - Node.js 内存使用量永远不会减少

css - 从主 SCSS 样式化 Angular 组件的元素

html - 为什么 Bootstrap 3.1.1 会颠倒列顺序?

sass - 使用 Sass 以可重用的方式设计一组特定的输入类型

javascript - 引用错误 : $traceurRuntime is not defined (in angularjs app)

javascript - javascript中的嵌套MongoDB查询