【问题标题】:Angular-fullstack | Yeoman - push to git with heroku failed角全栈 | Yeoman - 使用 heroku 推送到 git 失败
【发布时间】:2017-04-17 11:04:54
【问题描述】:

出于学校项目的目的,我需要使用 Yeoman 的 Angular-fullstack 生成器开发一个 Web 应用程序。

在此过程中,我需要使用 heroku 推送我的网络应用程序。我遵循了所有步骤,但是当我

    git push heroku master

我收到一条错误消息:

remote:        > typings install
remote:        
remote:        sh: 1: typings: not found
remote:        
remote:        npm ERR! Linux 3.13.0-100-generic
remote:        npm ERR! argv "/tmp/build_619bf0f5cc66ca8fa9680ec4149eaa76/.heroku/node/bin/node" "/tmp/build_619bf0f5cc66ca8fa9680ec4149eaa76/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_619bf0f5cc66ca8fa9680ec4149eaa76/.npmrc"
remote:        npm ERR! node v6.9.1
remote:        npm ERR! npm  v4.0.3
remote:        npm ERR! file sh
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno ENOENT
remote:        npm ERR! syscall spawn
remote:        npm ERR! projet-yboo-emotion@0.0.0 postinstall: `typings install`
remote:        npm ERR! spawn ENOENT
remote:        npm ERR!
remote:        npm ERR! Failed at the projet-yboo-emotion@0.0.0 postinstall script 'typings 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 projet-yboo-emotion package,
remote:        npm ERR! not with npm itself.
remote:        npm ERR! Tell the author that this fails on your system:
remote:        npm ERR!     typings install

...

remote:  !     Push rejected, failed to compile Node.js app.
remote: 
remote:  !     Push failed
remote: Verifying deploy....
remote: 
remote: !   Push rejected to ybooemotiont3m.
remote: 
To https://git.heroku.com/ybooemotiont3m.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to   'https://git.heroku.com/ybooemotiont3m.git'

我真的不明白为什么......我已经安装了打字:

    typings --version
    2.0.0

在我的package.json:

    "dependencies": {
    ...
    "typings": "^2.0.0"
    ...

【问题讨论】:

  • 我不太了解 Heroku,但查找 ENONET 可能会有所帮助。这是一个标准的 Linux 错误,描述为 Machine is not on the network
  • 你使用的是哪个 angular-fullstack 版本?
  • 我用的是最新的:generator-angular-fullstack@4.1.0
  • @DevManny 我做了一些研究。那么运行heroku run bash 会提供一个shell 环境吗?但是 nodecommand 不起作用。当转到/usr/local/src $ ls它是空的。我曾经输入gulp serve在localhost:3000上查看我的应用程序
  • 尝试在本地运行gulp serve:dist 并且...您在本地使用什么节点版本?

标签: git heroku gulp yeoman angular-fullstack


【解决方案1】:

在第一次将 angular-fullstack 项目推送到 heroku master 时,需要遵循简单的步骤。


这些步骤是使用 cmd 的 gulp 工具(适用于 Windows 机器)。

  1. 您必须从项目根目录运行 gulp build 才能进行生产构建。
  2. 将目录从项目根文件夹更改为构建文件夹(从 cmd)。
  3. 通过在 cmd 上键入 git init 来初始化 git 存储库。
  4. 在 heroku 仪表板上创建 heroku 项目。
  5. 如果您没有使用 heroku 登录,请在 cmd 上键入 heroku login。
  6. 通过键入 heroku git:remote -a(heroku 仪表板中您的应用程序的名称) 添加远程 heroku 存储库。例如 heroku git:remote -a myapp
  7. 键入 git add . 将所有文件添加到 git。
  8. 输入 git commit -am "make it better" 提交到 heroku git repo。
  9. 键入 git push heroku master 将 repo 推送到 heroku master。

【讨论】:

  • 今晚我试试这个!
猜你喜欢
  • 1970-01-01
  • 2020-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-30
相关资源
最近更新 更多