【问题标题】:Famo.us grunt serve gives blank browserFamo.us grunt serve 提供空白浏览器
【发布时间】:2014-05-06 02:44:21
【问题描述】:

尝试开始使用 Famo.us 示例。我按照 Github 页面上的步骤进行操作,当我执行“grunt serve”时,浏览器会打开,但出现以下错误:

    Failed to load resource: the server responded with a status of 404 (Not Found)
    http://localhost:1337/lib/famous-polyfills/functionPrototypeBind.js
    Failed to load resource: the server responded with a status of 404 (Not Found)  
    http://localhost:1337/lib/famous-polyfills/classList.js
    Failed to load resource: the server responded with a status of 404 (Not Found) 
    http://localhost:1337/lib/famous/core/famous.css
    Failed to load resource: the server responded with a status of 404 (Not Found)    
    http://localhost:1337/lib/famous-polyfills/requestAnimationFrame.js
    Failed to load resource: the server responded with a status of 404 (Not Found)   
    http://localhost:1337/lib/requirejs/require.js

在带有 Chrome 的 Windows 7 上运行它。知道如何解决这个问题吗?

【问题讨论】:

  • 这些文件是否真的存在于您的应用目录中?
  • 嗨,不,我在任何地方都找不到它们。 app 文件夹中仅有的 javascript 文件是 main.js 和 requireConfig.js。我没有更改任何内容,只是按照以下步骤操作: npm install -g yo grunt-cli bower generator- Famous mkdir newProject cd newProject yo Famous grunt serve

标签: gruntjs yeoman-generator famo.us


【解决方案1】:

您是否尝试过运行“凉亭安装”?默认情况下,所有这些依赖项都应该在您运行 'yo Famous' 时通过 bower 安装,但我见过一些没有安装的实例。

我会忽略上面关于通过 github 克隆的建议,还有其他依赖项,包括 require.js 和 almond,使用该方法不会安装

此外,就缩小版本而言...如果您运行“grunt”命令,您将通过 require.js / almond 为您提供所有依赖项的缩小、缓存破坏版本。这比简单地拥有库的缩小版本要好,因为它只会链接使用的模块。

FWIW 我是该工具的作者 :D

【讨论】:

  • 也有这个确切的问题..当我运行 yo Famous 时,它只会在安装一堆东西后坐在命令的末尾。然后我需要 control-c 来停止这个过程。然后我运行 grunt serve 它会给我一个空白页。为了解决这个问题,我运行了 bower install,它最终安装了所有著名的 polyfill 等。
【解决方案2】:

根据您的评论。如果这些文件不存在,您需要使它们存在。奇怪的是这些文件不是使用 ToolBelt 创建的。

只要去 github 获取你丢失的文件。

著名/核心:https://github.com/Famous/core

著名的填充物:https://github.com/Famous/polyfills

requirejs:https://github.com/Famous/examples/tree/master/src/lib

** 编辑 **

此工具的作者提交了更好的答案。请阅读 TheAlphNerd 的回复。

【讨论】:

  • 谢谢,顺便说一句。你知道我在哪里可以找到 famo.us 库的捆绑和缩小版本吗?
  • @doorman np.. 我还没有看到缩小版。我知道您获取了 Famo.us 大学源中链接的文件。但我不确定其中包含什么。
  • 尝试再次运行 bower install,然后 grunt serve
猜你喜欢
  • 2015-09-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-10-05
  • 2019-11-21
  • 1970-01-01
相关资源
最近更新 更多