私は同様のstackoverflowに関する質問を見てきましたが、それらのどれも私にとってはうまくいかないようです。私はHerokuにNodeJSアプリケーションをデプロイしようとしていましたが、bowerに関してherokuからこのメッセージにぶつかり続けています。私は手作業でバウアーを自分の依存関係に書こうとしましたが、それはうまくいかず、私も依存関係をbower.jsonからpackage.jsonに移そうとしましたが、それもうまくいきませんでした。そんなにありがとう、私はherokuログ、package.json、bower.jsonファイルを以下に入れました。NodeJsアプリケーションをHerokuに展開できません(bowerが見つかりません)
[email protected]インストール後に/ tmp/build_370f51a52877a36d300c739f31855511 リモート:>亭インストール リモート:
遠隔ます。sh:1:バウアー:私は私のpackage.jsonの下にリストされている
Package.json
"name": "angular-seed",
"private": true,
"version": "0.0.0",
"description": "A starter project for AngularJS",
"repository": "https://github.com/angular/angular-seed",
"license": "MIT",
"devDependencies": {
"bower": "^1.7.7",
"http-server": "^0.9.0",
"jasmine-core": "^2.4.1",
"karma": "^0.13.22",
"karma-chrome-launcher": "^0.2.3",
"karma-firefox-launcher": "^0.1.7",
"karma-jasmine": "^0.3.8",
"karma-junit-reporter": "^0.4.1",
"protractor": "^3.2.2"
},
"scripts": {
"postinstall": "bower install",
"prestart": "npm install",
"start": "http-server -a localhost -p 8000 -c-1 ./app",
"pretest": "npm install",
"test": "karma start karma.conf.js",
"test-single-run": "karma start karma.conf.js --single-run",
"preupdate-webdriver": "npm install",
"update-webdriver": "webdriver-manager update",
"preprotractor": "npm run update-webdriver",
"protractor": "protractor e2e-tests/protractor.conf.js",
},
"dependencies":{
"bower": "^1.7.9"
}
}
Bower.json
{
"name": "angular-seed",
"description": "A starter project for AngularJS",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular-seed",
"license": "MIT",
"private": true,
"dependencies": {
"angular": "~1.5.0",
"angular-route": "~1.5.0",
"angular-loader": "~1.5.0",
"angular-mocks": "~1.5.0",
"html5-boilerplate": "^5.3.0"
}
}
Herokuの
remote: -----> Creating runtime environment
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote: Resolving node version (latest stable) via semver.io...
remote: Downloading and installing node 5.11.1...
remote: Using default npm version: 3.8.6
remote: -----> Restoring cache
remote: Skipping cache restore (new runtime signature)
remote: -----> Building dependencies
remote: Installing node modules (package.json)
remote: > [email protected] postinstall /tmp/build_73e84e8327fb8bcb9b0e1cdc47631bca
remote: > bower install
remote: sh: 1: bower: not found
remote: npm ERR! Linux 3.13.0-95-generic
remote: npm ERR! argv
/tmp/build_73e84e8327fb8bcb9b0e1cdc47631bca/.heroku/node/bin/node" "/tmp/build_73e84e8327fb8bcb9b0e1cdc47631bca/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_73e84e8327fb8bcb9b0e1cdc47631bca/.npmrc"
remote: npm ERR! node v5.11.1
remote: npm ERR! npm v3.8.6
remote: npm ERR! file sh
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno ENOENT
remote: npm ERR! syscall spawn
remote: npm ERR! [email protected] postinstall: `bower install`
remote: npm ERR! spawn ENOENT
remote: npm ERR!
remote: npm ERR! Failed at the [email protected] postinstall script
bower install'.
remote: npm ERR! Make sure you have the latest version of node.js and npm installed.
remote: npm ERR! If you do, this is most likely a problem with the angular-seed package,
remote: npm ERR! not with npm itself.
remote: npm ERR! Tell the author that this fails on your system:
remote: npm ERR! bower install
remote: npm ERR! You can get information on how to open an issue for this project with
remote: npm ERR! npm bugs angular-seed
remote: npm ERR! Or if that isn't available, you can get their info via:
remote: npm ERR! npm owner ls angular-seed
remote: npm ERR! There is likely additional logging output above.
remote: npm ERR! Please include the following file with any support
remote: npm ERR! /tmp/build_73e84e8327fb8bcb9b0e1cdc47631bca/npm-debug.log
remote: -----> Build failed
ナダ、ご返信ありがとうございます。あなたが入力したときにpackage.jsonに手作業で書きましたが、端末にこのメッセージが残っています: sh:1:bower:not found npm ERR! argv "/tmp/build_9380f098e618099312acd138be466b7e/.heroku/node/bin/node" "/tmp/build_9380f098e618099312acd138be466b7e/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/ tmp/build_9380f098e618099312acd138be466b7e/.npmrc " npm ERR! [email protected] postinstall: 'bower install' – Omar
' npm install bower'を使用してバワーをインストールした後で*実行していますか? ./node_modules/bower/binフォルダーはどのように見えますか? – nadavvadan
いいえ、私は今すぐ次のステップでそれを試してみませんでした: 1. package.json "postinstall"で手動で書きます: "./node_modules/bower/bin/bower install" 2。ターミナルタイプでは:npm install bower 3. git push heroku master – Omar