用node.js部署挂起git push heroku master

时间:2017-01-19 19:11:24

标签: javascript node.js heroku webpack bundle

我的应用程序在本地运行,但在尝试部署到heroku时,它只是挂起。当我去网站时,它显示一个公共文件,但没有别的。它有此错误消息。我已经试图解决这个问题几天无济于事。如果有人有任何见解,我将非常感激!

https://analogy-alley.herokuapp.com/bundle.js Failed to load  

resource: the server responded with a status of 404 (Not Found)

我的终端在部署挂起时显示:

Counting objects: 80, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (75/75), done.
Writing objects: 100% (80/80), 8.04 KiB | 0 bytes/s, done.
Total 80 (delta 48), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Node.js app detected
remote: 
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NPM_CONFIG_PRODUCTION=false
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote: 
remote: -----> Installing binaries
remote:        engines.node (package.json):  6.3.1
remote:        engines.npm (package.json):   3.10.3
remote:        
remote:        Downloading and installing node 6.3.1...
remote:        npm 3.10.3 already installed with node
remote: 
remote: -----> Restoring cache
remote:        Loading 2 from cacheDirectories (default):
remote:        - node_modules
remote:        - bower_components (not cached - skipping)
remote: 
remote: -----> Building dependencies
remote:        Installing node modules (package.json)
remote:        analogy-alley@1.0.0 /tmp/build_7618a5799d312965a2e80f859861d507
remote:        └─┬ latest-version@2.0.0
remote:        └─┬ package-json@2.4.0
remote:        ├─┬ got@5.7.1
remote:        │ ├─┬ create-error-class@3.0.2
remote:        │ │ └── capture-stack-trace@1.0.0
remote:        │ ├── duplexer2@0.1.4
remote:        │ ├── is-redirect@1.0.0
remote:        │ ├── is-retry-allowed@1.1.0
remote:        │ ├── lowercase-keys@1.0.0
remote:        │ ├── node-status-codes@1.0.0
remote:        │ ├─┬ parse-json@2.2.0
remote:        │ │ └─┬ error-ex@1.3.0
remote:        │ │   └── is-arrayish@0.2.1
remote:        │ ├── read-all-stream@3.1.0
remote:        │ ├── timed-out@3.1.3
remote:        │ ├── unzip-response@1.0.2
remote:        │ └─┬ url-parse-lax@1.0.0
remote:        │   └── prepend-http@1.0.4
remote:        ├─┬ registry-auth-token@3.1.0
remote:        │ └─┬ rc@1.1.6
remote:        │   ├── deep-extend@0.4.1
remote:        │   ├── ini@1.3.4
remote:        │   ├── minimist@1.2.0
remote:        │   └── strip-json-comments@1.0.4
remote:        ├── registry-url@3.1.0
remote:        └── semver@5.3.0
remote:        
remote:        Running heroku-postbuild
remote:        
remote:        > analogy-alley@1.0.0 heroku-postbuild /tmp/build_7618a5799d312965a2e80f859861d507
remote:        > webpack -p --config ./webpack.config.js
remote:        
remote:        Hash: c32f71d9e77f2e675558
remote:        Version: webpack 1.14.0
remote:        Time: 11716ms
remote:        Asset     Size  Chunks             Chunk Names
remote:        ./public/bundle.js   238 kB       0  [emitted]  main
remote:        ./public/bundle.js.map  1.92 MB       0  [emitted]  main
remote:        + 206 hidden modules
remote:        
remote:        WARNING in ./public/bundle.js from UglifyJs
remote:        Condition always true [./~/react-dom/lib/ReactDOMComponentTree.js:103,0]
remote:        Dropping unused variable analogy [./browser/react/container/AnalogyBox.js:105,9]
remote:        Condition always true [./~/react-dom/lib/ReactNodeTypes.js:35,0]
remote:        Condition always true [./~/react-dom/lib/instantiateReactComponent.js:77,0]
remote:        Condition always true [./~/react-dom/lib/instantiateReactComponent.js:99,0]
remote:        Condition always true [./~/react-dom/lib/traverseAllChildren.js:144,0]
remote:        Condition always true [./~/react-dom/lib/ReactDOMComponent.js:976,0]
remote:        Condition always true [./~/react-dom/lib/ReactMultiChild.js:263,0]
remote:        Condition always true [./~/react-dom/lib/ReactMultiChild.js:283,0]
remote:        Condition always true [./~/react-dom/lib/findDOMNode.js:53,0]
remote:        Condition always true [./~/react-dom/lib/findDOMNode.js:55,0]
remote:        Condition always true [./~/react/lib/traverseAllChildren.js:144,0]

这是我的package.json

{
  "name": "analogy-alley",
  "version": "1.0.0",
  "private": true,
  "description": "",
  "main": "index.js",
  "engines": {
    "node": "6.3.1", 
    "npm": "3.10.3"
  },
  "production": {
    "use_env_variable": "DATABASE_URL"
  },
  "scripts": {
        "start": "webpack -w & nodemon --watch server -e js,html index.js",
    "build": "check-node-version --node '>= 6.7.0' && webpack",
    "build-watch": "check-node-version --node '>= 6.7.0' && webpack -w",
    "heroku-postbuild": "webpack -p --config ./webpack.config.js"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/jsharonk/analogy-alley.git"
  },
  "author": "jsk",
  "dependencies": {
    "ajax": "0.0.4",
    "axios": "^0.15.3",
    "babel": "^6.5.2",
    "babel-core": "^6.21.0",
    "babel-loader": "^6.2.10",
    "babel-preset-es2015": "^6.18.0",
    "babel-preset-react": "^6.16.0",
    "body-parser": "^1.15.2",
    "express": "^4.14.0",
    "jquery": "^3.1.1",
    "latest-version": "^2.0.0",
    "morgan": "^1.7.0",
    "pg": "^6.1.2",
    "pg-hstore": "^2.3.2",
    "react": "^15.4.2",
    "react-dom": "^15.4.2",
    "sequelize": "^3.29.0",
    "webpack": "^1.14.0"

  },
  "devDependencies": {
    "babel-core": "^6.21.0",
    "babel-loader": "^6.2.10",
    "babel-preset-es2015": "^6.18.0",
    "babel-preset-react": "^6.16.0",
    "babel-register": "^6.18.0",
    "webpack": "^1.14.0"
  }
}

1 个答案:

答案 0 :(得分:1)

我有类似的问题(挂在webpack步骤上)并解决了从webpack配置文件中删除watch: true属性的问题。