2017-02-04 11 views
0

ノード、bower、gulpを使用した角型アプリケーション。Herokuのデプロイに失敗しましたが、ローカルビルドとコンパイルが成功しました

問題 Herokuのにログインしようとしている:例外TypeError:関数ではありませんwが

初期は、ローカル環境でのビルドは罰金でした。 Gulpビルドしてログインすることができました。 Gulpをコンパイルし、ローカルIISにログインすることができました。 Herokuに展開し、上記のエラーを取得します。 Herokuの最後の正常なコミットに戻った後もローカルで複製できません。

プロジェクトのローカルバージョンを削除して再構築します。ローカル環境でエラーを複製できるようになりました。同じ角度リソース方法と同じ角度リソースバージョンのソリューションを見つける。角はバージョン1.5.9であり、角度リソースは1.6.1であった。角度リソースを1.5.9として再構築してみてください。ローカルでエラーなしでログインできるようになりました。エラーなしでローカルIISにビルドしてコンパイルできます。

更新bower.json:

{ 
    "name": "Removed", 
    "authors": [ 
    "Removed" 
    ], 
    "description": "Removed", 
    "main": "index", 
    "moduleType": [], 
    "keywords": [ 
    "Removed" 
    ], 
    "license": "MIT", 
    "homepage": "https://Removed", 
    "ignore": [ 
    "**/.*", 
    "node_modules", 
    "bower_components", 
    "test", 
    "tests" 
    ], 
    "dependencies": { 
    "bootstrap": "^3.3.6", 
    "angular": "1.5.9", 
    "angular-animate": "1.5.9", 
    "angular-resource": "1.5.9", 
    "angular-sanitize": "1.5.9", 
    "angular-touch": "1.5.9", 
    "angular-messages": "1.5.9", 
    "angular-toastr": "^1.7.0", 
    "angular-ui-tree": "^2.16.0", 
    "angular-bootstrap": "^1.3.3", 
    "angular-auto-validate": "^1.19.5", 
    "font-awesome": "^4.6.3", 
    "angular-snap": "^1.8.5", 
    "angular-localforage": "^1.2.5", 
    "underscore": "^1.8.3", 
    "angular-ui-router": "^0.3.1", 
    "angular-busy": "^4.1.3", 
    "aws-sdk": "aws-sdk-js#^2.6.11", 
    "ng-csv": "^0.3.6", 
    "angular-file-saver": "^1.1.2" 
    }, 
    "devDependencies": { 
    "angular-mocks": "1.5.9" 
    }, 
    "resolutions": { 
    "angular": "1.5.9", 
    "angular-animate": "1.5.9", 
    "angular-resource": "1.5.9" 
    } 
} 

そしてpackage.json:

{ 
    "name": "Removed", 
    "version": "1.0.0", 
    "description": "Removed", 
    "main": "app.js", 
    "engines": { 
    "node": "5.6.0", 
    "npm": "3.6.0" 
    }, 
    "cacheDirectories": [ 
    "node_modules", 
    "bower_components" 
    ], 
    "scripts": { 
    "postinstall": "bower cache clean && bower install && npm run build-all", 
    "start": "node server.js", 
    "build-all": "gulp inject index", 
    "test": "gulp test:unit", 
    "test-e2e": "gulp test:e2e" 
    }, 
    "repository": { 
    "type": "git", 
    "url": "git+https://github.com/Removed" 
    }, 
    "keywords": [ 
    "Removed" 
    ], 
    "author": "Removed", 
    "license": "MIT", 
    "bugs": { 
    "url": "https://Removed/" 
    }, 
    "homepage": "https://Removed/", 
    "dependencies": { 
    "bower": "1.7.7", 
    "browser-sync": "^2.11.1", 
    "del": "^2.2.0", 
    "express": "^4.13.4", 
    "fs": "0.0.2", 
    "gulp": "^3.9.0", 
    "gulp-angular-filesort": "^1.1.1", 
    "gulp-angular-templatecache": "^1.8.0", 
    "gulp-autoprefixer": "^3.1.0", 
    "gulp-beautify": "^2.0.0", 
    "gulp-cached": "^1.1.0", 
    "gulp-concat": "^2.6.0", 
    "gulp-csso": "^1.0.1", 
    "gulp-filter": "^3.0.1", 
    "gulp-flatten": "^0.2.0", 
    "gulp-htmlmin": "^1.3.0", 
    "gulp-imagemin": "^2.4.0", 
    "gulp-inject": "^3.0.0", 
    "gulp-less": "^3.0.5", 
    "gulp-less-import": "^1.0.0", 
    "gulp-ng-annotate": "^1.1.0", 
    "gulp-ng-constant": "^1.1.0", 
    "gulp-nodemon": "^2.0.6", 
    "gulp-open": "^1.0.0", 
    "gulp-protractor": "^2.1.0", 
    "gulp-rev": "^6.0.1", 
    "gulp-sourcemaps": "^1.6.0", 
    "gulp-uglify": "^1.5.1", 
    "gulp-wrapper": "^1.0.0", 
    "jasmine": "^2.4.1", 
    "jasmine-node": "^1.14.5", 
    "main-bower-files": "^2.11.1", 
    "plato": "^1.5.0", 
    "protractor": "^3.1.1", 
    "require-dir": "^0.3.0", 
    "selenium-standalone": "^4.9.1", 
    "selenium-webdriver": "^2.52.0", 
    "yargs": "^3.32.0" 
    }, 
    "devDependencies": {} 
} 

問題がまだでもきれいキャッシュ、および依存関係をマッチングしてHerokuの上で持続します。ビルドログはきれいで、問題がないことが読み取られます。 これがHerokuで動作するのに何が欠けていますか?小項目と

Herokuのログは、問題が依存関係をパッケージ化したことによるもの

-----> Node.js app detected 
-----> Creating runtime environment 

    NPM_CONFIG_LOGLEVEL=error 
    NPM_CONFIG_PRODUCTION=true 
    NODE_VERBOSE=false 
    NODE_ENV=production 
    NODE_MODULES_CACHE=true 
-----> Installing binaries 
    engines.node (package.json): 5.6.0 
    engines.npm (package.json): 3.6.0 

    Downloading and installing node 5.6.0... 
    npm 3.6.0 already installed with node 
-----> Restoring cache 
    Loading 2 from cacheDirectories (package.json): 
    - node_modules 
    - bower_components 
-----> Building dependencies 
    Installing node modules (package.json) 

    > **removed**[email protected] postinstall /tmp/build_f9f5334ca3b4f65239fd45fcbf9493ea/**removed**-959eff2 
    > bower cache clean && bower install && npm run build-all 


    > **removed**[email protected] build-all /tmp/build_f9f5334ca3b4f65239fd45fcbf9493ea/**removed**-959eff2 
    > gulp inject index 

    [18:43:00] Using gulpfile /tmp/build_f9f5334ca3b4f65239fd45fcbf9493ea/**removed**/gulpfile.js 
    [18:43:00] Starting 'clean:inject'... 
    [18:43:00] Starting 'clean:scripts'... 
    [18:43:00] Starting 'clean:assets'... 
    [18:43:00] Starting 'clean:app-config'... 
    [18:43:00] Starting 'clean:bower-fonts'... 
    [18:43:00] Starting 'clean:styles'... 
    [18:43:00] Starting 'clean-index'... 
    [18:43:00] Starting 'clean:app-js'... 
    [18:43:00] Starting 'clean:lib-js'... 
    [18:43:00] Starting 'clean:app-css'... 
    [18:43:00] Starting 'clean:fonts'... 
    [18:43:00] Starting 'clean:images'... 
    [18:43:00] Finished 'clean:inject' after 24 ms 
    [18:43:00] Finished 'clean:scripts' after 18 ms 
    [18:43:00] Starting 'scripts'... 
    [18:43:00] Finished 'clean:app-config' after 50 ms 
    [18:43:00] Starting 'app-config'... 
    [18:43:01] Finished 'clean:styles' after 55 ms 
    [18:43:01] Starting 'styles'... 
    [18:43:01] Finished 'clean:assets' after 109 ms 
    [18:43:01] Starting 'assets'... 
    [18:43:01] Finished 'clean:bower-fonts' after 111 ms 
    [18:43:01] Starting 'bower-fonts'... 
    [18:43:01] Finished 'clean-index' after 115 ms 
    [18:43:01] Finished 'clean:app-css' after 112 ms 
    [18:43:01] Starting 'app-css'... 
    [18:43:01] Finished 'clean:app-js' after 155 ms 
    [18:43:01] Starting 'app-js'... 
    [18:43:01] Finished 'clean:lib-js' after 171 ms 
    [18:43:01] Starting 'lib-js'... 
    [18:43:01] Finished 'clean:fonts' after 211 ms 
    [18:43:01] Starting 'fonts'... 
    [18:43:01] Finished 'clean:images' after 215 ms 
    [18:43:01] Starting 'images'... 
    [18:43:11] Finished 'app-config' after 11 s 
    [18:43:19] gulp-imagemin: Minified 14 images (saved 44.42 kB - 5.5%) 
    [18:43:33] Finished 'bower-fonts' after 33 s 
    [18:43:35] Finished 'lib-js' after 35 s 
    [18:43:35] Finished 'assets' after 35 s 
    [18:43:35] Finished 'images' after 35 s 
    [18:43:36] Finished 'fonts' after 35 s 
    [18:43:39] Finished 'styles' after 38 s 
    [18:43:42] Finished 'app-css' after 42 s 
    [18:43:42] Finished 'scripts' after 42 s 
    [18:43:42] Starting 'inject'... 
    [18:43:42] gulp-inject 30 files into index.html. 
    [18:43:42] gulp-inject 49 files into index.html. 
    [18:43:42] Finished 'inject' after 213 ms 
    [18:43:46] Finished 'app-js' after 46 s 
    [18:43:46] Starting 'index'... 
    [18:43:46] gulp-inject 1 files into index.html. 
    [18:43:46] gulp-inject 2 files into index.html. 
    [18:43:46] Finished 'index' after 27 ms 
-----> Caching build 
    Clearing previous node cache 
    Saving 2 cacheDirectories (package.json): 
    - node_modules 
    - bower_components 
-----> Build succeeded! 
-----> Discovering process types 
    Procfile declares types  -> (none) 
    Default types for buildpack -> web 
-----> Compressing... 
    Done: 53M 
-----> Launching... 
    Released v89 
    **removed** deployed to Heroku 
+0

にされたもの 'engines'アプリのために使うのですか? – orvi

+0

@ orvi WebStormは開発ツールであり、ノード、bower、gulpを使用しています。 IISはライブに渡す前に私のローカル展開用です。これもIISです。 – Dave

+0

いいえいいえ。あなたの 'package.json'ファイルに' engines'を追加しましたか? – orvi

答えて

0

編集さ。 bower.jsonファイルが更新されました。

角度は^ 1.6.1に設定し、他の角度のパッケージ^ 1.5.9

関連する問題