Famo.us grunt serve提供空白浏览器

时间:2014-05-02 14:38:25

标签: gruntjs yeoman-generator famo.us

尝试开始使用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上运行它。知道如何解决这个问题吗?

2 个答案:

答案 0 :(得分:5)

您是否尝试过运行" bower install"?所有这些依赖项都应该默认通过bower安装,当你运行“着名的”时,但我已经看到了一些它没有的情况。

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

另外,就缩小版本而言...如果你运行" grunt"命令您将通过require.js / almond为您提供所有依赖项的缩小,缓存已破坏版本。这比仅使用缩小版本的库更好,因为它只链接在使用的模块中。

FWIW我是该工具的作者:D

答案 1 :(得分:0)

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

只需去github并抓住你丢失的文件。

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

着名的polyfills:https://github.com/Famous/polyfills

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

**编辑**

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

相关问题