我正在尝试制作我的第一个自耕农应用程序.我按照以下链接中的每一步操作:http://ponderingdeveloper.com/2013/03/08/preparing-a-windows-machine-to-use-yeoman/
当我执行yo webapp一切顺利.
但是当我使用grunt命令时,我面临以下错误:
grunt --trace
Running "jshint:all" (jshint) task
>> 4 files lint free.
Running "clean:server" (clean) task
Cleaning ".tmp"...OK
Running "concurrent:test" (concurrent) task
Running "coffee:dist" (coffee) task
Warning: Errno::ENOENT on line ["33"] of C: No such file or directory - C:/D
ysk Google/Sublime/Norbert/motocycle/app/bower_components
Run with --trace to see the full backtrace Use --force to continue.
Aborted due to warnings.
Run Code Online (Sandbox Code Playgroud)
我找了bower_components文件夹 - 它不存在.我知道我可以更改文件中的.bowerrc目录,但我不知道哪个目录是正确的,我找不到它.
编辑:程序版本:
C:\Dysk Google\Sublime\Norbert\motocycle>grunt --version
grunt-cli v0.1.8 …Run Code Online (Sandbox Code Playgroud) 我想在数组中找到索引.数组中的位置是对象,我想过滤它们的属性.我知道我想要过滤哪些键及其值.问题是获得符合标准的数组索引.
现在我制作了代码来过滤数据并给我回溯对象数据,但没有给出数组索引.
var data = [
{
"text":"one","siteid":"1","chid":"default","userid":"8","time":1374156747
},
{
"text":"two","siteid":"1","chid":"default","userid":"7","time":1374156735
}
];
var filterparams = {userid:'7', chid: 'default'};
function getIndexOfArray(thelist, props){
var pnames = _.keys(props)
return _.find(thelist, function(obj){
return _.all(pnames, function(pname){return obj[pname] == props[pname]})
})};
var check = getIndexOfArray(data, filterparams ); // Want to get '2', not key => val
Run Code Online (Sandbox Code Playgroud)