Procfile commands was not found with dokku and node js - node.js

I'm trying to deploy my nuxt app with dokku but web:command was not found
i'm trying to run:
web: npm run start
but it gives me:
web:: command not found

Related

How do I run npm package commands on Heroku

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.

How to get heroku to detect nodejs buildpack?

I am trying to deploy a web app to heroku but keep getting this error:
`-----> Failed to detect app matching https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz buildpack`
Here is a simplified look my app file structure:
myProject
|__server
|__server.js
|__react_component_1
|__react_componet_2
|__styles</p>
The express server is the server.js inside the server directory and it will the entry way to my app.
It seems like this question has been asked many times before and I've read all the answers, here's what I have tried:
I am deploying from the root folder, myProject, which did not have a package.json file. I've tried npm init to set up a package.json so heroku can detect the app as nodejs. I've also made sure that package.json is being tracked by git. I've made a Procfile: web: cd server && npm run start. I have run the command in the cli to set buildpack: heroku buildpacks:set heroku/nodejs but so far none of it has worked. I've also tried buildpacks:clear after setting everything up to see if heroku can automatically detect buildpacks now that I have a package.json.
Any help is appreciated, thank you.
According to Heroku's relevant documentation on Node.js buildpacks:
The Heroku Node.js buildpack is employed when the application has a package.json file in the root directory.
Based on your Procfile content, web: cd server && npm run start, that looks like you ran npm init inside the server directory, not the root directory.
I think if you move package.json and the node_modules folder one directory down to the root, the buildpack issue will be resolved. Just make sure to change your Procfile to web: npm run start because it would be the same directory now.

webpack-dev-server error on node js app deployment on gcloud

I am trying to deploy my node js application on gcloud app engine. Project uses web pack-dev-server as a dev dependency. When I run it on gcloud as a localhost using npm install all works fine and there is no compilation error. But when I am deploying using gcloud app deploy I get the error below.
> webpack-dev-server --content-base src --inline --hot --progres
ssh: 1:webpack-dev-server: not found
I tried giving root access to node_module folder. I am using node v6.11.0 and npm 3.6.0. Any idea what could be the issue?

Heroku with Django and node build

I am pushing everything from BitBucket to Heroku, using Pipelines. The problem are static files because I am using django-gulp which will compile all sass files (using nodejs and gulp) when I call collectstatic.
It will first push code to Heroku and run it, but as it turns out all other scripts (pip install, npm install, ...) will execute on BitBucket side, and not Heroku. My Profile has this inside:
web: gunicorn magistrska_web.wsgi --log-file -
Website is running, but there are no static files.
If always run with DISABLE_COLLECTSTATIC=1, otherwise I get the following
remote: -----> $ python manage.py collectstatic --noinput
remote: /bin/sh: 1: gulp: not found
What I would need to do is for Heroku to first run npm install before collectstatic or it won't work, but I am having hard time finding any documentation on this.
heroku local web works fine, because I ran collectstatic before locally.
bitbucket-pipelines.yml configuration:
image: nikolaik/python-nodejs
pipelines:
default:
- step:
script:
- git push https://heroku:$HEROKU_API_KEY#git.heroku.com/$HEROKU_APP_NAME.git HEAD
- pip install -r requirements.txt
- npm install
- npm install -g gulp
- python manage.py collectstatic --noinput
The solution was way too easy!
I needed to add another, nodejs buildpack on Heroku and it worked! Example below

Deploying App on heroku node command not found

I have basically modified this app
https://github.com/heroku/node-js-getting-started.git
Now am trying to deploy in Heroku
My Procfile has this line
web:node index.js
And when I run this command locally,there are no probs..
However if I try to open the link in my browser after following all the steps in https://blog.risingstack.com/node-hero-deploy-node-js-heroku-docker/
I get an error
On checking the logs using heroku logs command I am getting 'node command not found'
Anyone knows the prob?
P.S : I tried changing Procfile contents to npm start but that doesnt launch index.js in the browser.
I suspect that you have not set the buildpacks. Buildpacks tells heroku which kind of application is yours.
Use the below command to set the application of type nodejs.
heroku buildpacks:set heroku/nodejs
And make sure that you have a package.json file in the root of the project which is read by heroku to install the project dependencies.
Why don't you try this below in your Procfile.In my case it runs nicely.
web npm install
You just need to add nodejs buildpack on heroku settings app,
after that you will be able to use npm commands.

Resources