Angular-fullstack | Yeoman - 用heroku推送git失败了

时间:2016-12-02 13:55:42

标签: git heroku gulp yeoman angular-fullstack

出于学校项目的目的,我需要使用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"
    ...

1 个答案:

答案 0 :(得分:0)

首次将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“使其更好”以提交heroku git repo。
  9. 键入 git push heroku master 以推送heroku master上的repo。
相关问题