【问题标题】:How to deploy angular gulp app to heroku without nodejs如何在没有nodejs的情况下将angular gulp应用程序部署到heroku
【发布时间】:2016-08-10 06:55:41
【问题描述】:

我有this 主题,我想部署到heroku。问题是我没有在其中使用 nodejs,但我遇到的所有教程都使用 node、yaemon 等,这不是我的情况。

我尝试过创建 procfile

web: node app.js

但部署时出错。

remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NPM_CONFIG_PRODUCTION=true
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:
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:
remote: -----> Restoring cache
remote:        Skipping cache restore (new runtime signature)
remote:
remote: -----> Building dependencies
remote:        Installing node modules (package.json)
remote:
remote:        > blur_admin@1.2.0 postinstall /tmp/build_5d79cad1abda92d62d5cf18
0cf8e22c1
remote:        > bower install
remote:
remote:        sh: 1: bower: not found
remote:
remote:        npm ERR! Linux 3.13.0-91-generic
remote:        npm ERR! argv "/tmp/build_5d79cad1abda92d62d5cf180cf8e22c1/.herok
u/node/bin/node" "/tmp/build_5d79cad1abda92d62d5cf180cf8e22c1/.heroku/node/bin/n
pm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_5d79cad1abda92d62d5cf18
0cf8e22c1/.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! blur_admin@1.2.0 postinstall: `bower install`
remote:        npm ERR! spawn ENOENT
remote:        npm ERR!
remote:        npm ERR! Failed at the blur_admin@1.2.0 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 blur_a
dmin 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 blur_admin
remote:        npm ERR! Or if that isn't available, you can get their info via:
remote:        npm ERR!     npm owner ls blur_admin
remote:        npm ERR! There is likely additional logging output above.
remote:
remote:        npm ERR! Please include the following file with any support reque
st:
remote:        npm ERR!     /tmp/build_5d79cad1abda92d62d5cf180cf8e22c1/npm-debu
g.log
remote:
remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot common is
sues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploy
s
remote:
remote:        Some possible problems:
remote:
remote:        - Node version not specified in package.json
remote:        https://devcenter.heroku.com/articles/nodejs-support#specifying-a
-node-js-version
remote:
remote:        - Bower may not be tracked in package.json
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploy
s#ensure-you-aren-t-relying-on-untracked-dependencies
remote:
remote:        Love,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote:

有人可以帮忙吗?

谢谢

【问题讨论】:

  • 你可以发布错误
  • @SaE 更新了问题

标签: angularjs heroku angular gulp web-deployment


【解决方案1】:

您似乎没有将“bower”添加为依赖项。检查您的 package.json 文件。您需要在“依赖项”部分中有一个“凉亭”条目。比如:

  "dependencies": {
    "bower": "^1.8.0",
   }

也许您已经拥有 bower 有一个 devDepencendy,但对于 Heroku,您也需要将它放在其他部分。你也可以检查这个link,它有另一种方法。 希望对您有所帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-25
    • 2017-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-26
    • 1970-01-01
    相关资源
    最近更新 更多