Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

HOST=[host] NODE_ENV=production npm run depoy gives error #571

Closed
hophacker opened this issue Feb 17, 2016 · 17 comments
Closed

HOST=[host] NODE_ENV=production npm run depoy gives error #571

hophacker opened this issue Feb 17, 2016 · 17 comments

Comments

@hophacker
Copy link

npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "/root/.nvm/versions/node/v5.6.0/bin/node" "/root/.nvm/versions/node/v5.6.0/bin/npm" "run" "compile"
npm ERR! node v5.6.0
npm ERR! npm  v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] compile: `babel-node bin/compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] compile script 'babel-node bin/compile'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-redux-starter-kit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel-node bin/compile
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-redux-starter-kit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls react-redux-starter-kit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/No.497-H5-yuejian/npm-debug.log

npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "/root/.nvm/versions/node/v5.6.0/bin/node" "/root/.nvm/versions/node/v5.6.0/bin/npm" "run" "deploy"
npm ERR! node v5.6.0
npm ERR! npm  v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] deploy: `better-npm-run deploy`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy script 'better-npm-run deploy'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-redux-starter-kit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     better-npm-run deploy
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-redux-starter-kit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls react-redux-starter-kit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/No.497-H5-yuejian/npm-debug.log
@hophacker hophacker changed the title HOST=[host] NODE_ENV=production npm run depoy gives error HOST=[host] NODE_ENV=production npm run depoy gives error Feb 17, 2016
@dvdzkwsk
Copy link
Owner

Could you please post your npm-debug.log? Will try to repro, but difficult to tell right off the bat.

@dvdzkwsk
Copy link
Owner

I haven't been able to reproduce this, do you have any additional information about this error?

@hophacker
Copy link
Author

Sorry for my late replay, it is here:
npm-debug.txt

@DonovanCharpin
Copy link

Exactly the same error on my side.

@hophacker
Copy link
Author

@Donovan-Ensicaen The most weird thing to me is that this is a transitional issue. It never happened in my desktop, but it bothers me on the server side SOMETIMES, all with the same code base, running the same command, which is npm run deploy

@DonovanCharpin
Copy link

@hophacker I use npm run deploy on local and I always have the error. I can't figure out the issue.

@DonovanCharpin
Copy link

Ok it works on my side, I can run npm run deploy. Be careful to remove all compiling errors as indentation, semicolons etc. Even if it compile, I'm not able to deploy it on heroku...

@codetony25
Copy link

Having the same issue here. Not able to deploy on heroku.

@hophacker
Copy link
Author

It seems that you need to clear all the errors output showing on "npm run
dev" to ensure it works in production mode.
But I think it's unnecessary since some errors generated by flow are
"wrong" errors.

On Mon, Feb 29, 2016 at 1:33 PM, Tony Tai Nguyen [email protected]
wrote:

Having the same issue here. Not able to deploy on heroku.


Reply to this email directly or view it on GitHub
#571 (comment)
.

冯杰
排忧网络技术有限责任公司
苏州工业园区星湖街328号创意产业园

Cell: 86-15862355582
Linkedin: https://www.linkedin.com/pub/jie-feng/7a/a2a/194

Prev: Comprehend Systems, 2010 Broadway #200, Redwood City, CA 94063
Education: The Johns Hopkins University, Master of Science

@dvdzkwsk
Copy link
Owner

I might try deploying it myself to heroku today to see if I can repro.

@DonovanCharpin
Copy link

Thanks @davezuko. I tried to just git pull / build / deploy and it was not working on my side.

@romanenko
Copy link

I have the same issue when I try to deploy on heroku or a private VPS server on CentOS. Locally (OSX El Capitan) both npm run compile and NODE_ENV=production npm run compile runs and finishes successfully.

Same npm ERR! code ELIFECYCLE error pointing to at EventEmitter.<anonymous> (... /node_modules/npm/lib/utils/lifecycle.js:232:16). Looks very similar to #350, but I'm sure I have the latest node (5.7.0) and npm (3.7.5) and npm cache clear doesn't help.

@romanenko
Copy link

Here is the excerpt from my npm-debug.log:

[429] ./~/redux-form/lib/events/isEvent.js 237 bytes {1} [built]
[430] ./~/redux-form/lib/events/silenceEvent.js 453 bytes {1} [built]
[431] ./~/redux-form/lib/getDisplayName.js 206 bytes {1} [built]
[432] ./~/redux-form/lib/getValues.js 1.62 kB {1} [built]
[433] ./~/redux-form/lib/getValuesFromState.js 1.15 kB {1
npm verb lifecycle [email protected]~compile: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~compile: PATH: /tmp/build_81c895bc33520498d87f9abc614abd7c/.heroku/node/lib/node_modules/npm/bin/node-gyp-bin:/tmp/build_81c895bc33520498d87f9abc614abd7c/node_modules/.bin:/tmp/build_81c895bc33520498d87f9abc614abd7c/.heroku/node/bin:/tmp/build_81c895bc33520498d87f9abc614abd7c/.heroku/node/lib/node_modules/npm/bin/node-gyp-bin:/tmp/build_81c895bc33520498d87f9abc614abd7c/node_modules/.bin:/tmp/build_81c895bc33520498d87f9abc614abd7c/.heroku/node/bin:/tmp/build_81c895bc33520498d87f9abc614abd7c/.heroku/node/bin:/app/bin:/app/vendor/bundle/bin:/app/vendor/bundle/ruby/2.3.0/bin:/usr/local/bin:/usr/bin:/bin:/tmp/codon/vendor/bin
npm verb lifecycle [email protected]~compile: CWD: /tmp/build_81c895bc33520498d87f9abc614abd7c
npm info lifecycle [email protected]~compile: Failed to exec compile script
npm verb stack Error: [email protected] compile: `better-npm-run compile`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/tmp/build_81c895bc33520498d87f9abc614abd7c/.heroku/node/lib/node_modules/npm/lib/utils/lifecycle.js:239:16)
npm verb stack     at emitTwo (events.js:100:13)
npm verb stack     at EventEmitter.emit (events.js:185:7)
npm verb stack     at ChildProcess.<anonymous> (/tmp/build_81c895bc33520498d87f9abc614abd7c/.heroku/node/lib/node_modules/npm/lib/utils/spawn.js:24:14)
npm verb stack     at emitTwo (events.js:100:13)
npm verb stack     at ChildProcess.emit (events.js:185:7)
npm verb stack     at maybeClose (internal/child_process.js:827:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
npm verb pkgid [email protected]
npm verb cwd /tmp/build_81c895bc33520498d87f9abc614abd7c
npm ERR! Linux 3.13.0-77-generic
npm ERR! argv "/tmp/build_81c895bc33520498d87f9abc614abd7c/.heroku/node/bin/node" "/tmp/build_81c895bc33520498d87f9abc614abd7c/.heroku/node/bin/npm" "run" "compile"
npm ERR! node v5.7.0
npm ERR! npm  v3.7.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] compile: `better-npm-run compile`
npm ERR! Exit status 1
npm ERR!

My app is based on this (awesome! :) ) starter-kit and all the main important config files left almost untouched.

@romanenko
Copy link

I figured out what caused this error. I did rm -rf node_modules, then npm cache clear and then npm install --production.

After that, when I ran npm run compile error was shown, that redux-devtools-dock-monitor and redux-devtools-log-monitor was missing. So I've moved them to dependencies section in package.json and the error is gone! Yay!

However I had to add eslint-config-standard-jsx to dependencies also, as well as I had to change server/main.js a bit to make production server start without errors:

    // ...
    // ------------------------------------
    // Apply Webpack HMR Middleware
    // ------------------------------------
    if (config.env === 'development') {
      const webpackDevMiddleware = require('./middleware/webpack-dev').default
      const webpackHMRMiddleware = require('./middleware/webpack-hmr').default
      const compiler = webpack(webpackConfig)

      // Enable webpack-dev and webpack-hot middleware
      const { publicPath } = webpackConfig.output

      app.use(webpackDevMiddleware(compiler, publicPath))
      app.use(webpackHMRMiddleware(compiler))

    // ...

@dvdzkwsk
Copy link
Owner

dvdzkwsk commented Mar 2, 2016

Thanks for the info @romanenko, I will make those changes in master later.

@DonovanCharpin
Copy link

Oh thanks @romanenko ! Not easy to catch. I hope I will be able to deploy on heroku after this fix :)

@dvdzkwsk
Copy link
Owner

dvdzkwsk commented Mar 4, 2016

Going to close this for now since the issue is actually tangential as @romanenko has figured out (production-only dependencies) and has a bigger scope (improved error reporting). I will be creating a more formal issue to tackle this once I return from vacation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants