heroku running gulp build - node.js

i am trying to install a node app onto heroku. My application requires both gulp build and gulp install to be called on the server upon instillation, however i am having troubles doing this.
I have tried writing this inside of the package.json:
"scripts":"gulp build && gulp install"
which works at first, but after about an hour the server must restart and recall the script causing for the contents of the server to be rebuilt. this removes all of my content such as newly written blogs or changes.
I have also tried using the heroku toolbelt
heroku run gulp build
heroku run gulp install
However, even though it produces the correct console write lines and looks asif it has made the necessary changes, it hasn't, the server produces an error which proves that the resources haven't been built meaning that the console command didnt make any changes to the actual server files.
Am i missing something out here? Thanks in advance.

So i have figured out that the problem lies with the fact that i have tried to use a LevelDB database on heroku. Apparently, heroku uses no-writable dynos, meaning that the levelDB database is unable to save.

Related

Installed JsZip but its not working by grunt

I used https://stuk.github.io/jszip/ on my local machine and update all dependency by npm and used command grunt connect but this only showing web server started but on this url its not working.
$ grunt connect
Running "connect:server" (connect) task
Started connect web server on http://localhost:9999
Done, without errors.
even i have tested the app there is no error,
can anyone let me know how to get such type of projects from git-hub and run locally by npm or composer/bower.
I have used simple javascript instead of going with NodeJs and here my code is :
Here is Gist Code you can run.

Webpack Node.js on Heroku Deployment Error

I built an application with React/Node.js/PostgreSQL Webpack and now attempting to deploy on heroku.
Everything works perfectly on my localhost, but it doesn't serve on Heroku. error message image on Heroku -
I've tried multiple buildpacks to make it happen, but it still gives me the same result, and I cannot figure out the problem as my logs don't seem to have any issues.
Any ideas would be greatly appreciated.
Here is the link to my repo https://github.com/strongharris/Edu-it
To Run it:
npm install ->
npm run build ->
npm start
The problem here is with your code. I tried to deploy a copy of your project to Heroku, and it's giving me an error because config.connection does not exist when you use it in a conditional.
Here's the error:
(These logs were retrieved by me deploying the Heroku app, then running heroku logs to view the log output.)
As you can see, the error is here: https://github.com/strongharris/Edu-it/blob/master/server/database/database_config.js#L9
You'll need to re-write this code so it runs properly without that variable.

Meteor Buildpack for Cloud Foundry

I'm trying to get the meteor buildpack for cloud foundry running and its almost there except right at the end I get a node command not found error. I've confirmed that during the build I can run node and npm version commands. I get no errors until the instance fails to start.
Node gets installed into a folder called .vendor. I'm new to linux but is it possible that this folder isn't accessible at some point for some reason because of the dot? Meteor gets installed into a folder called vendor so I will try installing node there too. Can anyone think of something else to try?? I also tried changing the node folder to 777 in case it was a permissions thing. Far as I can tell the PATH variable is setup correctly.
I got the app deployed by converting to a node app and using the node buildpack but i'd prefer to use the meteor buildpack.

Heroku cannot find ./node_modules/.bin/forever in Procfile of Yeoman MEAN app

I've been trying to get a Yeoman generated MEAN.js app deployed to Heroku for the best part of a day without much luck.
I've carefully gone through all the steps and am pretty sure I've done everything correctly according to documentation.
After several times going through and ensuring the database is configured correctly with heroku config, removing the public/dist folder from the .gitignore, running grunt build, setting NODE_ENV=production, and running a successful Heroku build the app just continuously shows the very unhelpful Heroku Application Error page.
Upon checking the heroku logs the only thing I can find is this:
bash: ./node_modules/.bin/forever: No such file or directory
Process exited with status 127
Which clearly refers to the Procfile that contains this single line and is where the app is supposed to start from.
web: ./node_modules/.bin/forever -m 5 server.js
There is a server.jsin the root of the project so I tried modifying the Procfile to a standard web: node server.js but that doesn't fix it and I am not comfortable messing with the default Yeoman configuration.
The ./node_modules/.bin/forever is of course there where it is supposed to be. But it obviously isn't showing up or cannot be located in the live Heroku build. If anyone knows what the problem is here and how to fix it I'd much appreciate the help! Cheers!
This happened to me after I upgraded my nodejs, I can't figure out why exactly it is happening, but here is my fix for it asap,
When I ran heroku run ls node_modules/.bin/
I could not find forever there. So I installed and save it to my dependencies by running npm install forever --save
On running heroku run ls node_modules/.bin/ again, it was there and my app runs fine.
I'll sure update this soon, once I figure what exactly led to it.

Meteor requires Node v0.10.41 or later Error on heroku deployment

I recently tried deploying my first MeteorJS (1.3) application on heroku and am getting a server log error - "Meteor requires Node v0.10.41 or later". Not sure what the relationship is between node and meteor. Do meteor apps actually need a node backend or is this a meteor bug?
Also, when I run "meteor node -v" I get v0.10.43 which IS a later version so I'm not sure what the problem is when deploying.
It's a problem with buildpack "jordansissel/heroku-buildpack-meteor.git"
Meteor 1.3 requires Node 0.10.41, and this buildpack compiles node at 0.10.40.
I submitted a pull request for a new buildpack, or try my fork at https://github.com/kevinseguin/heroku-buildpack-meteor.git
I've faced the same problem with deploying new version of meteor 1.3 and also spent the best part of the day, but eventually got easy solution!
You take last buildpack for meteor 1.3:
https://github.com/michaltakac/meteor-buildpack-horse and then doing everything as shown there, but instead doing git push heroku master, you do
git push -f heroku master
So the whole bunch for your commands:
>heroku create <yourapp>
>heroku buildpacks:set https://github.com/michaltakac/meteor-buildpack-horse.git
>heroku addons:create mongolab
>heroku config:set ROOT_URL=https://<yourapp>.herokuapp.com
>git push -f heroku master
Thanks to gitjason for his advice to get the right direction.
In case anyone else comes here, after trying the fixes here my app still had errors launching on Heroku, but the error messages were not verbose and only continued to give the Node version error. This series of fixes got it going.
1. in terminal, npm install - for me this re-installed npm. I also ran "meteor update" but I knew there was no significant update that would break my app.
2. check the .gitignore file - something important might be in there. In my case, "newrelic" folder was in there but not referenced as a dependency in package.json. To fix this make sure all subfolders have a dependency reference in package.json (recommended) or else remove node_modules from .gitignore (creates extra fetching, not recommended but works).
3. use Kevin's build path above - or another updated Meteor build package - I used the horse package. Make sure you add .git to the end of the URL like so:
heroku buildpacks:set https://github.com/kevinseguin/heroku-buildpack-meteor.git --app myAppName
4. set the $PATH - in terminal:
PATH=$PATH:$HOME/.meteor
5. set the ROOT_URL in Heroku - some instructions out there say to set it as "myAppName.herokuapp.com". This causes an error in Heroku. It is fixed if you prepend, "http://", like so, "http://myAppName.herokuapp.com".
Did you search on the web or in the Meteor documentation, before posting? From the documentation, it says,
Your JavaScript code can run in two environments: the client
(browser), and the server (a Node.js container on a server).
Basically, Meteor runs on top of node JS with all the boiler plate for reactivity and other features.
EDIT:
Now meteor also has a guide.

Resources