gpt4 book ai didi

linux - Grunt Package cmd 在运行 minall 任务时失败(ubuntu 和 windows)

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:31:42 25 4
gpt4 key购买 nike

我正在努力学习本教程 https://docs.angularjs.org/misc/contribute在我的操作系统上安装 angularJS 但我坚持这一步:

# Build AngularJS:
grunt package

当我执行“sudo grunt package”命令时,我得到了这个:

Running "bower" task

Running "clean:build" (clean) task
Cleaning build...OK

Running "clean:tmp" (clean) task
Cleaning tmp...OK

Running "buildall" task
>> File build/angular-scenario.js created.
>> File build/angular.js created.
>> File build/angular-loader.js created.
>> File build/angular-touch.js created.
>> File build/angular-mocks.js created.
>> File build/angular-sanitize.js created.
>> File build/angular-resource.js created.
>> File build/angular-messages.js created.
>> File build/angular-animate.js created.
>> File build/angular-route.js created.
>> File build/angular-cookies.js created.
>> File build/angular-aria.js created.
>> File tmp/promises-aplus-adapter++.js created.

Running "minall" task
ERROR - Cannot read: Needed

ERROR - Cannot read: a

ERROR - Cannot read: revision

ERROR - Cannot read: single

4 error(s), 0 warning(s)
Warning: Error minifying build/angular-animate.js Use --force to continue.

Aborted due to warnings.

我真的不明白是什么让 minall 失败了......

我正在做所有这些,因为当启动 karma 时,我得到这个错误:

$ karma start karma.conf.js 
INFO [karma]: Karma v0.12.24 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 38.0.2125 (Linux)]: Connected on socket bMZ0eWE4QWE4XZTs0cny with id 13199010
Chrome 38.0.2125 (Linux) ERROR
Uncaught ReferenceError: angular is not defined
at /path/javascripts/app.js:1

我运气不好吗?

感谢您的帮助!

最佳答案

我遇到了同样的问题。

这个问题/bug(?!) 关于通过 git clonebower install 安装 angular 的区别。默认情况下,grunt package taks 尝试使用 git 命令来检测当前版本并提交 sha。但是,如果您使用 bower——这是行不通的,并且会生成此类警告。

有我的解决方法:

找到./lib/versions/versions-info.js然后转到getBuid()函数。

function getBuild() {
var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', '');
if (hash.code === 0) { // just check code answer as in other places
return 'sha.'+hash;
}
return '';
}

关于linux - Grunt Package cmd 在运行 minall 任务时失败(ubuntu 和 windows),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26298411/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com