【问题标题】:NodeJS on Heroku: Push rejected, failed to compile Node.js appHeroku 上的 NodeJS:推送被拒绝,无法编译 Node.js 应用程序
【发布时间】:2016-02-25 23:19:31
【问题描述】:

当我运行 gulp serve 时,我有一个 AngularJS 应用程序可以在 localhost:3000 中完美运行。我正在尝试将其推送到 Heroku,但我收到了这些错误。正如在其他帖子中看到的,我的.gitignore 中有node_modules/,但即使在运行npm cache clearnpm install 之后,错误仍然存​​在。如果我运行bower install --config.interactive=false,我会得到一个空白输出。

-----> 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"
  }
}

【问题讨论】:

    标签: angularjs node.js heroku


    【解决方案1】:

    您可能会遇到这个打开的 npm 问题:

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

    该错误仅在存在 node_modules 时发生,因此您可以通过禁用该目录的缓存来解决此问题:

    $ heroku config:set NODE_MODULES_CACHE=false
    

    【讨论】:

    • 那么,完整的日志会比 npm 错误更有用。
    • 按照建议添加了整个日志文件
    • 您使用的是第 3 方构建包,不保证支持标准 Heroku 选项(如 NODE_MODULES_CACHE)。您应该按照本教程并使用官方 buildpack(gulp 设置与 grunt 设置非常相似):devcenter.heroku.com/articles/node-with-grunt
    猜你喜欢
    • 2020-09-24
    • 1970-01-01
    • 2016-01-10
    • 2018-12-16
    • 2014-02-08
    • 2014-04-14
    • 2023-03-07
    • 2020-06-05
    • 1970-01-01
    相关资源
    最近更新 更多