2017-04-07 5 views
2

私はHerokuにAngularアプリを配備していますが、Angularコンポーネントと他のいくつかのコンポーネントを追加するにはバワーが必要です。デプロイメントは動作しています。デプロイされたサイトを除くすべてにbower_componentsフォルダがありません。私はすべてを通過し、多くのStackOverflowの記事を読んできましたが、私は何かが欠けているに違いありません。ここに私のコードは次のとおりです。Heroku - いいえbower_componentsフォルダ

{ 
    "name": "my-webapp", 
    "description": "", 
    "main": "app.js", 
    "authors": [ 
    "Me" 
    ], 
    "license": "ISC", 
    "homepage": "https://my-webapp.herokuapp.com/", 
    "ignore": [ 
    "**/.*", 
    "node_modules", 
    "bower_components", 
    "test", 
    "tests" 
    ], 
    "dependencies": { 
    "angular-material-icons": "^0.7.1", 
    "angular-material": "^1.1.1", 
    "materialize": "^0.97.8", 
    "ng-lodash": "^0.5.0" 
    } 
bower.json

package.json

{ 
    "name": "my-webapp", 
    "version": "1.0.0", 
    "main": "app.js", 
    "dependencies": { 
    "bower": "^1.8.0", 
    "express": "^4.15.2" 
    }, 
    "devDependencies": {}, 
    "scripts": { 
    "start": "node web.js", 
    "postinstall": "./node_modules/bower/bin/bower install" 
    }, 
    "repository": { 
    "type": "git", 
    "url": "git+https://github.com...." 
    }, 

    "author": "", 
    "license": "ISC", 
    "bugs": { 
    "url": "https://github.com..." 
    }, 
    "homepage": "https://github.com...", 
    "description": "" 
} 

web.js

var express = require('express'), 
app = express(); 

app.use(express.static(__dirname)); 
app.get('/', function(req, res) { 
    res.sendfile('index.html', {root: __dirname }) 
}); 
var server = app.listen(process.env.PORT || 80); 

Procfile

web: node web.js 

すべてが動作しているかのように私には

-----> Building dependencies 
     Prebuild detected (node_modules already exists) 
     Rebuilding any native modules 
     [email protected] /tmp/build_9a163093ad395af381c984026f6a5742/me-my-webapp-bfae0f9/node_modules/bower 
     [email protected] /tmp/build_9a163093ad395af381c984026f6a5742/mugwag-my-webapp-bfae0f9/node_modules/express 
-----> Caching build 
     Clearing previous node cache 
     Saving 2 cacheDirectories (default): 
     - node_modules 
     - bower_components 
-----> Build succeeded! 

-----> Rebuilding any native dependencies 
     [email protected] /tmp/build_9a163093ad395af381c984026f6a5742/me-my-webapp-bfae0f9/node_modules/bower 
     [email protected] /tmp/build_9a163093ad395af381c984026f6a5742/me-my-webapp-bfae0f9/node_modules/express 
????????? [email protected] 
npm WARN [email protected] No description 
-----> Found bower.json, running bower install 
-----> Installing dependencies 

     > [email protected] postinstall /tmp/build_9a163093ad395af381c984026f6a5742/me-my-webapp-bfae0f9 
     > ./node_modules/bower/bin/bower install 

     npm WARN [email protected] No description 

、それは見えますが、私はページをロードするとき、私はこのようなフォルダbower_componentsへのリンク切れの負荷を取得:ここ

は、ビルド出力、編集されたハイライトであります:

にはバウアーのフォルダがありません

/bower_components/materialize/dist/css/materialize.css取得することはできません。なぜ!?

答えて

0

FYI - この問題は決して解決しませんでしたが、現在はAmazon S3を使用して角型アプリケーションをホストしています。 Angularは完全にクライアント側であるため、サーバーは必要ありません。コードをS3などにアップロードして、簡単にホスティングして直接参照してください。

私は誰かを助けることを願っています。

関連する問題