简体   繁体   English

Heroku上的NodeJS:推送被拒绝,无法编译Node.js应用

[英]NodeJS on Heroku: Push rejected, failed to compile Node.js app

I have an AngularJS app that works perfectly in localhost:3000 when I run gulp serve . 当我运行gulp serve时,我有一个AngularJS应用程序,可以在localhost:3000完美运行。 I am trying to push it to Heroku and I get these errors. 我试图将其推送到Heroku,但出现这些错误。 As seen in other posts, I have node_modules/ in my .gitignore , but the error is still there, even after running npm cache clear and npm install . 如在其他文章中node_modules/ ,我的.gitignorenode_modules/ ,但是即使运行npm cache clearnpm install之后,错误仍然存​​在。 If I run bower install --config.interactive=false I get a blank output. 如果我运行bower install --config.interactive=false得到空白输出。

-----> LOG FILE -----> 日志文件

PACKAGE.JSON PACKAGE.JSON

{
  "name": "mymodule",
  "version": "0.0.5",
  "dependencies": {
    "express": "^4.13.3",
    "bower": "1.6.5",
    "gulp-connect": "~2.0.6",
    "gzippo": "^0.2.0"
  },
  "scripts": {
    "test": "gulp test",
    "start": "node node_modules/gulp/bin/gulp serveprod",
    "postinstall": "./node_modules/bower/bin/bower install --config.interactive=false"
  },
  "devDependencies": {
    "gulp": "~3.9.0",
    "gulp-autoprefixer": "~2.3.1",
    "gulp-angular-templatecache": "~1.6.0",
    "del": "~1.2.0",
    "lodash": "~3.9.3",
    "gulp-csso": "~1.0.0",
    "gulp-filter": "~2.0.2",
    "gulp-flatten": "~0.0.4",
    "gulp-jshint": "~1.11.0",
    "gulp-load-plugins": "~0.10.0",
    "gulp-size": "~1.2.1",
    "gulp-uglify": "~1.2.0",
    "gulp-useref": "~1.2.0",
    "gulp-util": "~3.0.5",
    "gulp-ng-annotate": "~1.0.0",
    "gulp-replace": "~0.5.3",
    "gulp-rename": "~1.2.2",
    "gulp-rev": "~5.0.0",
    "gulp-rev-replace": "~0.4.2",
    "gulp-minify-html": "~1.0.3",
    "gulp-inject": "~1.3.1",
    "gulp-protractor": "~1.0.0",
    "gulp-sourcemaps": "~1.5.2",
    "gulp-sass": "~2.0.1",
    "gulp-angular-filesort": "~1.1.1",
    "main-bower-files": "~2.8.0",
    "merge-stream": "~0.1.7",
    "jshint-stylish": "~2.0.0",
    "wiredep": "~2.2.2",
    "karma": "~0.12.36",
    "karma-jasmine": "~0.3.5",
    "karma-phantomjs-launcher": "~0.2.0",
    "karma-angular-filesort": "~0.1.0",
    "karma-ng-html2js-preprocessor": "~0.1.2",
    "concat-stream": "~1.5.0",
    "require-dir": "~0.3.0",
    "browser-sync": "~2.7.12",
    "browser-sync-spa": "~1.0.2",
    "http-proxy-middleware": "~0.0.5",
    "chalk": "~1.0.0",
    "uglify-save-license": "~0.4.1",
    "wrench": "~1.5.8"
  },
  "engines": {
    "node": ">=0.10.0"
  }
}

You may be running into this open npm issue: 您可能会遇到以下打开的npm问题:

https://github.com/npm/npm/issues/9633 https://github.com/npm/npm/issues/9633

The bug only occurs when node_modules is present, so you can workaround by disabling caching of that directory: 该错误仅在存在node_modules时发生,因此您可以通过禁用该目录的缓存来解决:

$ heroku config:set NODE_MODULES_CACHE=false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM