Comments (12)
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.
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.
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.
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.
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.
@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.
this worked for me, thanks guys
from express-es6-rest-api.
Nothing working for me
from express-es6-rest-api.
can any one suggest how to use es6 in heroku with babel
from express-es6-rest-api.
Close this issue as it's nothing to do with this repository, this problem lies with Heroku.
from express-es6-rest-api.
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.
Hey guys, if you still having this problem this worked for me
from express-es6-rest-api.
Related Issues (20)
- async/await syntax HOT 3
- Docker Deployment: 404 HOT 1
- No longer works (most likely due to new modules) HOT 1
- Question about middleware HOT 2
- How add custom API? HOT 1
- How to set environment variables? HOT 1
- node dist failure HOT 1
- can you add an example of how to use with mongoose-restful
- why not use babel-preset-env
- How to import models?
- 404 but the object is still returned HOT 1
- Add a test for /src/api/facets.js HOT 1
- to test DELETE method, AND PUT
- nv
- sh: babel: command not found
- Requires Babel "^7.0.0-0", but was loaded with "6.26.3".
- seems to have stopped updating, wash wash and sleep
- how to change port? HOT 4
- Bodyparser package is deprecated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from express-es6-rest-api.