2017-02-17 8 views
0

私は古いAngularJS(1)アプリケーションを使い始めました。古いAngularJSアプリケーション用のGruntfile内の未定義オブジェクト

昨日の私の依存関係をアップグレードした後、modulerequireオブジェクトが(未定義に)定義されていません。

{ 
    "name": "nitro-project", 
    "version": "0.0.0", 
    "dependencies": { 
    "angular": "*", 
    "json3": "*", 
    "es5-shim": "*", 
    "stacktrace": "*", 
    "firebase": "*", 
    "angular-resource": "*", 
    "angular-cookies": "*", 
    "angular-sanitize": "*", 
    "angular-animate": "*", 
    "angular-touch": "*", 
    "angular-route": "*", 
    "angular-ui-router": "*", 
    "angular-translate": "*", 
    "angular-base64": "*", 
    "angular-bootstrap": "*", 
    "angular-utils-pagination": "*", 
    "angular-ui-utils": "*", 
    "angular-file-upload": "*", 
    "a0-angular-storage": "*", 
    "sockjs": "*", 
    "stomp-websocket": "*" 
    }, 
    "devDependencies": { 
    "angular-mocks": "*", 
    "angular-scenario": "*", 
    "karma-jasmine": "*" 
    }, 
    "appPath": "app", 
    "resolutions": { 
    "es5-shim": "*", 
    "angular": "*", 
    "angular-bootstrap": "*", 
    "angular-mocks": "*" 
    } 
} 

そしてpackage.jsonファイルの内容::私はノード6.8.1を実行している

{ 
    "name": "nitroproject", 
    "version": "0.0.0", 
    "dependencies": {}, 
    "devDependencies": { 
    "grunt": "*", 
    "grunt-autoprefixer": "*", 
    "grunt-concurrent": "*", 
    "grunt-contrib-clean": "*", 
    "grunt-contrib-concat": "*", 
    "grunt-contrib-connect": "^1.0.2", 
    "grunt-contrib-copy": "*", 
    "grunt-contrib-cssmin": "*", 
    "grunt-contrib-htmlmin": "*", 
    "grunt-contrib-imagemin": "*", 
    "grunt-contrib-jshint": "*", 
    "grunt-contrib-uglify": "*", 
    "grunt-contrib-watch": "*", 
    "grunt-filerev": "*", 
    "grunt-google-cdn": "*", 
    "grunt-karma": "*", 
    "grunt-newer": "*", 
    "grunt-ng-annotate": "*", 
    "grunt-ng-constant": "*", 
    "grunt-svgmin": "*", 
    "grunt-usemin": "*", 
    "grunt-wiredep": "*", 
    "jasmine-core": "*", 
    "jshint-stylish": "*", 
    "karma": "*", 
    "karma-chrome-launcher": "*", 
    "karma-jasmine": "*", 
    "karma-phantomjs-launcher": "*", 
    "load-grunt-tasks": "*", 
    "serve-static": "^1.11.2", 
    "time-grunt": "*" 
    }, 
    "engines": { 
    "node": ">=6.8.1" 
    }, 
    "scripts": { 
    "test": "grunt test" 
    } 
} 

// Generated on 2014-10-21 using generator-angular 0.9.8 
'use strict'; 

module.exports = function (grunt) { 

    // Load grunt tasks automatically 
    require('load-grunt-tasks')(grunt); 

    ... 

} 

は、ここに私のbower.jsonファイルの内容です。

ない依存関係が古くなっている:

[[email protected] nitro-project] 
$ npm outdated 
[[email protected] nitro-project] 

コンソールログには、このようなラインの負荷を示しています

プロジェクトディレクトリで
Running "newer:jshint:all" (newer) task 

Running "jshint:all" (jshint) task 

Gruntfile.js 
    line 2 col 1 Use the function form of "use strict". 
    line 4 col 1 'module' is not defined. 
    line 7 col 3 'require' is not defined. 
    line 10 col 3 'require' is not defined. 
    line 12 col 21 'require' is not defined. 
    line 16 col 10 'require' is not defined. 
    line 147 col 19 'require' is not defined. 

答えて

0

私がしようとするだろう:

npm uninstall 
npm install -g grunt-cli 
npm install 

新規インストールあなたの依存関係(特にグランツ)が必要なものかもしれません。そうでない場合は、トラブルシューティングを行う前に一発の価値があります。

+0

私はあなたの 'npm'コマンドを実行しましたが、それは問題に何も変更されませんでした。 – Stephane

関連する問題