How do I run npm package commands on Heroku - node.js

I am using node-mongo-seeds in my express app to seed data. I deployed the app to Heroku and SSHed into the dyno, but running 'seed' command gives me command not found.

Related

Using NPM on Digitalocean NodeJS droplet fails

I cloned my github repository onto a default NodeJS droplet on Digitalocean and everything works fine, I am running:
cd /my-project-directory
npm install
npm start
But I always get this error message: Imgur
The Digitalocean placeholder is already running in Node, I tried to kill the process but it always respawns before I can run npm start. How can I have my app run and be displayed when opening my-site.com in the browser?

Pm2 starts the process but node app inaccessible

I'm new to PM2 and nodejs, I'm trying to learn node by following simple sample that creates a server that displays 'Hello World' from the browser. Please note that I'm running node on QNAP NAS. I have successfully installed nodejs, npm, and pm2. when I run app.js via node app.js, it works and I see the message using the port specified.
but when I run via pm2 start app.js, I got this
Then after a few seconds I got status = errored
when I look at the log I got this.
I tried searching in google but the result were pointing to old version of node which I don't
Node itself has to be built with inspector. You can try to install LTS version of node.
Alternatively, you can try installing node-inspector with npm i node-inspector --save

How to run a npm script on a deployed Heroku NodeJS app

Under scripts in package.json I have the following.
'refresh': node refresh db
Is there a way to trigger this particular npm script on a NodeJS app deployed on Heroku.
Yes:
$ heroku run npm run refresh
Per the Heroku Node.js Documentation, you can add pre and post install scripts. In addition, you can add scripts that can be triggered by environment variables.
You can also do this using only the browser; Just log in to manage your app in the heroku dashboard (https://dashboard.heroku.com/apps/[app_name]) and there click on the right side of it:
More > Run console
Then you can run any command:
command line in heroku
https://devcenter.heroku.com/changelog-items/1137

Deployment Issue in Mean Io on Azure

I have deployed the mean app on azure ubuntu box. I have installed all the modules and dependencies of node using npm install and bower dependencies using bower install. The app in logs show that it is started on port 3000 but when I see the browser console it show this error:
aggregated.js:11 Uncaught Error: [$injector:modulerr]
http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=mean&p1=Error%3A%20…
http%3A%2F%2Fsecondreveiw.cloudapp.net%2Fmodules%2Faggregated.js%3A26%3A19)
I have aggregated true in my development.js config file.
By the way the app is working fine locally on my windows machine.

Roostagram node.js IIS

I've been successful in installing node.js and iisnode on my windows server running IIS. I just got back from the jQuery/ROOST conference and I'm playing with the app that they put together. For whatever reason after I've cloned the git repo and installed all packages with npm I'm still not able to get the app running.
I am able to run the app if I run grunt through the command prompt and it starts the test webserver on port 8000, however I would like IIS run the app and handle all requests...
Thanks!
p.s. here is the repo https://github.com/bocoup/roostagram.git

Resources