GithubHelp home page GithubHelp logo

Comments (12)

hpdobrica avatar hpdobrica commented on May 8, 2024 30

I had the same problem, it's because heroku doesn't automatically install dev-dependencies for npm, you need to set config variable NPM_CONFIG_PRODUCTION in heroku to false and it will work :)

from express-es6-rest-api.

developit avatar developit commented on May 8, 2024 15

This is just an oddity of Heroku - they run your build and deploy from Git (both development tools), but don't install development modules. In general, I would recommend setting NPM_CONFIG_PRODUCTION=false on Heroku.

from express-es6-rest-api.

Direcious avatar Direcious commented on May 8, 2024 4

in script use

"start":"babel-node index.js" instead of using "start":"babel index.js"

This should not be used for production.

from express-es6-rest-api.

MicheleMaltese avatar MicheleMaltese commented on May 8, 2024 2

I had the same problem, it's because heroku doesn't automatically install dev-dependencies for npm, you need to set config variable NPM_CONFIG_PRODUCTION in heroku to false and it will work :)

you are a lifesaver <3

from express-es6-rest-api.

ricksterhd123 avatar ricksterhd123 commented on May 8, 2024 1

can any one suggest how to use es6 in heroku with babel

Hi today I've been trying to do this myself. I've figured it out.
First, lets assume you setup babel correctly by using the command:
npm install --save-dev @babel/core @babel/cli

Inside package.json the result should be:

{
  "devDependencies": {
+   "@babel/cli": "^7.0.0",
+   "@babel/core": "^7.0.0"
  }
}

Now to the solution:
Other repo issues that mentioned this issue said you need to set the environment variable NPM_CONFIG_PRODUCTION=false, this can be done inside settings or via the console with command: heroku config:set NPM_CONFIG_PRODUCTION=false, and apparently the reason is because heroku does not install dev dependencies on production and in order for 'babel' to be defined development dependencies need to be installed.

Hopefully this should fix yours and anyone else's issue.

from express-es6-rest-api.

adamchenwei avatar adamchenwei commented on May 8, 2024

@hpdobrica that seems not a long term solution... what is the core reason? I would like to see how it actually got resolved completely thanks a lot!

from express-es6-rest-api.

chunkingz avatar chunkingz commented on May 8, 2024

this worked for me, thanks guys

from express-es6-rest-api.

akash123456347 avatar akash123456347 commented on May 8, 2024

Nothing working for me

from express-es6-rest-api.

akash123456347 avatar akash123456347 commented on May 8, 2024

can any one suggest how to use es6 in heroku with babel

from express-es6-rest-api.

ricksterhd123 avatar ricksterhd123 commented on May 8, 2024

Close this issue as it's nothing to do with this repository, this problem lies with Heroku.

from express-es6-rest-api.

 avatar commented on May 8, 2024

NPM_CONFIG_PRODUCTION

ERROR: connect ECONNREFUSED 127.0.0.1:5432

This is the error I get when I apply your fix. please help :(

from express-es6-rest-api.

TheJarX avatar TheJarX commented on May 8, 2024

Hey guys, if you still having this problem this worked for me

from express-es6-rest-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.