简体   繁体   中英

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 . I am trying to push it to Heroku and I get these errors. 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 . If I run bower install --config.interactive=false I get a blank output.

-----> LOG FILE

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:

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:

$ heroku config:set NODE_MODULES_CACHE=false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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