Procfile working locally but not in heroku CLI - heroku

So I am trying to make my procfile for Heroku CLI but I don't think Heroku is recognizing it because when I do $ git push heroku main the Procfile doesn't work rather it does npm start rather than what's written in the Procfile but it works when I run it locally like heroku local --procfile=procfile. And I'm pretty sure that the P of my profile is correct so that's not the issue
When I do $ git push heroku main ( Updated ): https://i.stack.imgur.com/gGcSZ.png
When I do $ heroku local --procfile=procfile
https://i.stack.imgur.com/BErzz.png
Folder Pic:
https://i.stack.imgur.com/blHei.png
Procfile : worker: node index.js
Full git view + commiting :-
https://i.stack.imgur.com/KYOHw.png
package.json :
"name": "ban-counter",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"discord.js": "^13.6.0"
}
}

Just had to add "start": "node index.js" to the scripts in the package.json therefore now resulting in:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
start": "node index.js"
},

Related

Yarn does not see workspaces

I have the following configuration in a root workspace. The strange thing is that for backend it works, but for frontend - doesn't, no matter how I rename this
{
"private": true,
"name": "root",
"workspaces": [
"packages/frontend",
"packages/backend"
],
"scripts": {
"client": "yarn workspace frontend start",
"client-test": "yarn workspace frontend test",
"server": "yarn workspace backend start",
"start": "conc --kill-others-on-fail \"yarn client\" \"yarn server\""
},
"devDependencies": {
"concurrently": "^7.6.0"
}
}
And it always says: $ yarn workspace frontend test
error Unknown workspace "frontend".
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I tried to start from all directories, nothing works
The thing is that it does not matter how folders are called inside of "packages", the important thing is that package.json of each workspace should be called correspondingly:
{
"name": "frontend",
"version": "1.0.0",
"private": true,
...
}

Yarn install loops itself

I get yarn loops when starting my server.
>Console Listener setup OK
>Started map fivem-map-hipster
>Started resource fivem-map-hipster
>[yarn] yarn install v1.22.5
>[yarn] [1/4] Resolving packages...
and then it loops and tries to resolve the package again.
My package.json looks like this:
{
"name": "webpack-builder",
"version": "1.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"async": "^3.1.0",
"webpack": "^4.41.2",
"worker-farm": "^1.7.0"
}
}
what am I missing?

npm showing severity vulnerabilities Laravel in ubuntu 18.04 LTS

running command npm install laravel-mix cross-env --save-dev from web/themes/custom/cp_bootstrap4 directory npm showing severity vulnerabilities Laravel in ubuntu 18.04 LTS
added 744 packages from 474 contributors and audited 745 packages in 90.492s
found 1 moderate severity vulnerability
I have tried commands
1. npm audit fix
2. npm audit fix --force
but 1 severity vulnerabilities not solved.
Output of above command
npm audit security report
Manual Review
Some vulnerabilities require your attention to resolve
Moderate file-type vulnerable to Infinite Loop via malformed MKV file
Package file-type
Patched in >=16.5.4
Dependency of laravel-mix [dev]
Path laravel-mix > imagemin > file-type
my sub-theme package.json
{
"name": "cp_bootstrap4",
"version": "1.0.0",
"description": "[Bootstrap 4](https://www.drupal.org/project/bootstrap4) subtheme.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"cross-env": "^7.0.3",
"laravel-mix": "^6.0.49"
}
}
Please suggest me to resolve this issue!
Try adding to your package.json an override that means it will replace a package in your dependency tree with another version.
The package that has vulnerabilities is file-type, but npm says that you have to update the dependent-package (package>dependent-package>package-with-vulnerabilities), so you will have to update imagemin.
It seems that laravel-mix have not fix this issue, but the solution all ready exist.
Check this URL: https://snyk.io/test/npm/laravel-mix/6.0.20#SNYK-JS-FILETYPE-2958042
Try with this code on your package.json
{
"name": "cp_bootstrap4",
"version": "1.0.0",
"description": "[Bootstrap 4](https://www.drupal.org/project/bootstrap4) subtheme.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"cross-env": "^7.0.3",
"laravel-mix": "^6.0.49"
},
"overrides": {
"laravel-mix": {
"imagemin": "^8.0.1"
}
}
}

Deploying Preact to Heroku

I've written a pretty simple app in Preact. No back end server, just front-end calling a web API and displaying the results.
I set it up on Heroku and it reports that it deployed successfully, but trying to access the app fails right out the gate:
2020-09-14T02:10:11.845503+00:00 heroku[web.1]: Starting process with command `npm start`
2020-09-14T02:10:14.403769+00:00 app[web.1]: npm ERR! missing script: start
How should I [define a start script to] make this work?
In development I run yarn dev like the Preact docs suggest. My guess is that's just a dev server though.
FWIW, Here's my package.json
{
"private": true,
"name": "clips-preact",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"build": "preact build",
"serve": "sirv build --port 8080 --cors --single",
"dev": "preact watch",
"lint": "eslint src"
},
"eslintConfig": {
"extends": "eslint-config-synacor"
},
"eslintIgnore": [
"build/*"
],
"devDependencies": {
"eslint": "^6.0.1",
"eslint-config-synacor": "^3.0.4",
"preact-cli": "^3.0.0",
"sirv-cli": "^1.0.3"
},
"dependencies": {
"axios": "^0.20.0",
"preact": "^10.1.0",
"preact-render-to-string": "^5.1.2",
"recoil": "^0.0.10"
}
}
I'm late, but to anyone who comes across this, you shouldn't be running a separate server at all.
Preact CLI builds to static output. Just point your webserver (nginx, apache) at the directory and let it handle serving the files.
Give this a try:
{
"private": true,
"name": "clips-preact",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"build": "preact build",
"serve": "sirv build --port 8080 --cors --single",
"dev": "preact watch",
"lint": "eslint src",
// Your file name ↓ make sure to remove this comment before you go.
"start": "node index.js"
}
You have to add "start" inside the "scripts" area, then as you running your script type "node your_file_name" this will make "npm start" command run "node your_file_name" command.

procfile no changing from web to worker

I'm trying to Host my bot "chompbot" in Heroku.
But when i change Procfile from web to worker, does not change anything.
I've tried
Here is my package.json
"name": "chompbot",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"discord.js": "^11.5.1",
"mysql": "^2.17.1"
}
}
And here is my Procfile
worker: index.js
When i commit and push, anything happens on "Web", and do not appears "Worker" option
( Ps.: The MySql database is fully working on cloud, so, can't be the dependencies )
Can someone help me to change from Web to Worker?
http://prntscr.com/pb21qs
Your worker should be the script that starts you server, index.js is only the file name. What you want to do is to use your npm start script instead of index.js

Resources