2016-07-25 6 views
0

"grunt serve"를 실행하면 "ReferenceError : angular is defined"가 나타납니다. 여기 내 app.js 및 index.html입니다. "bower update", "bower install"을 실행하려고했지만 작동하지 않았습니다.ReferenceError : 각도가 정의되지 않았습니다. Yeoman

/client/app/app.js

'use strict'; 

angular.module('contactsServerApp', [ 
'ngCookies', 
'ngResource', 
'ngSanitize', 
'btford.socket-io', 
'ui.router', 
'ui.bootstrap' 
]) 

index.html을

(부품)
<!-- bower:js --> 
<script src="bower_components/jquery/dist/jquery.js"></script> 
<script src="bower_components/angular/angular.js"></script> 
<script src="bower_components/json3/lib/json3.js"></script> 
<script src="bower_components/angular-resource/angular-resource.js"></script> 
<script src="bower_components/angular-cookies/angular-cookies.js"></script> 
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script> 
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script> 
<script src="bower_components/lodash/dist/lodash.compat.js"></script> 
<script src="bower_components/angular-socket-io/socket.js"></script> 
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script> 
<!-- endbower --> 
<script src="socket.io-client/socket.io.js"></script> 
<!-- endbuild --> 
<!-- build:js({.tmp,client}) app/app.js --> 
<script src="app/app.js"></script> 
<!-- injector:js --> 
<script src="app/account/account.js"></script> 
<script src="app/account/login/login.controller.js"></script> 
<script src="app/account/settings/settings.controller.js"></script> 
<script src="app/account/signup/signup.controller.js"></script> 
<script src="app/admin/admin.controller.js"></script> 
<script src="app/admin/admin.js"></script> 
<script src="app/main/main.controller.js"></script> 
<script src="app/main/main.js"></script> 
<script src="components/auth/auth.service.js"></script> 
<script src="components/auth/user.service.js"></script> 
<script src="components/modal/modal.service.js"></script> 
<script src="components/mongoose-error/mongoose-error.directive.js"></script> 
<script src="components/navbar/navbar.controller.js"></script> 
<script src="components/socket/socket.service.js"></script> 
<!-- endinjector --> 
<!-- endbuild --> 

내가 실행

"꿀꿀 봉사"
$ grunt serve 
Running "serve" task 

Running "clean:server" (clean) task 

Running "env:all" (env) task 

Running "concurrent:server" (concurrent) task 

Running "injector:scripts" (injector) task 
Missing option `template`, using `dest` as template instead 
Injecting js files (14 files) 

Running "injector:css" (injector) task 
Missing option `template`, using `dest` as template instead 
Injecting css files (5 files) 

Running "wiredep:target" (wiredep) task 
client/index.html modified. 

Running "autoprefixer:dist" (autoprefixer) task 

Running "express:dev" (express) task 
Starting background Express server 
Debugger listening on port 5858 
e:\ContactDocuments\Backend\client\app\app.js:3 
angular.module('contactsServerApp', [ 
^ 

ReferenceError: angular is not defined 
at Object.<anonymous> (e:\ContactDocuments\Backend\client\app\app.js:3:1) 
at Module._compile (module.js:409:26) 
at Object.Module._extensions..js (module.js:416:10) 
at Module.load (module.js:343:32) 
at Function.Module._load (module.js:300:12) 
at Function.Module.runMain (module.js:441:10) 
at startup (node.js:139:18) 
at node.js:968:3 

Running "wait" task 
>> Waiting for server reload... 
Done waiting! 

Running "open:server" (open) task 

Running "watch" task 
Waiting... 

는 당신이이 있습니까 이 오류에 대한 아이디어?

+0

'NPM의 install '이다를 추가 할 수 있습니다, 다음'이물은 –

+0

는 사용중인 발전기 install'이다? – austinthedeveloper

+0

@ScottSelby 시도했지만 작동하지 않았습니다. –

답변

0
  1. .bowerrc에서 "bower_components"를 "app/bower_components"로 변경 한 다음 'bower install'을 다시 실행하십시오.
  2. 스크립트 파일에 지연 태그를 추가하십시오.
  3. 또는 CDN 링크를 사용할 수 있습니다.

정자 명령은 꿀꺽 꿀꺽 실행되지 않습니다. 당신은 같은 꿀꺽 파일에 정자를 설치해야합니다

gulp.task('serve', function (cb) { 
    runSequence('clean:tmp', 
    ['lint:scripts'], 
    ['start:client'], 
    ['bower'], 
    'watch', cb); 
});