Ok so I am having problems setting up a preact app of mine to heroku. I hooked it up to github so it builds straight into heroku, but it won't get past the preact serve and build. Here is my heroku log.
2018-10-21T09:09:23.986026+00:00 heroku[web.1]: Starting process with command `npm start`
2018-10-21T09:09:27.624952+00:00 app[web.1]:
2018-10-21T09:09:27.624970+00:00 app[web.1]: > portfolio-page#0.0.0 start /app
2018-10-21T09:09:27.624972+00:00 app[web.1]: > if-env NODE_ENV='production' && npm run serve || npm run dev
2018-10-21T09:09:27.624974+00:00 app[web.1]:
2018-10-21T09:09:28.595955+00:00 app[web.1]:
2018-10-21T09:09:28.595995+00:00 app[web.1]: > portfolio-page#0.0.0 serve /app
2018-10-21T09:09:28.595997+00:00 app[web.1]: > preact build && preact serve
2018-10-21T09:09:28.595999+00:00 app[web.1]:
2018-10-21T09:09:28.605427+00:00 app[web.1]: sh: 1: preact: not found
2018-10-21T09:09:28.613622+00:00 app[web.1]: npm ERR! file sh
2018-10-21T09:09:28.613973+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-21T09:09:28.614303+00:00 app[web.1]: npm ERR! errno ENOENT
2018-10-21T09:09:28.614652+00:00 app[web.1]: npm ERR! syscall spawn
2018-10-21T09:09:28.617301+00:00 app[web.1]: npm ERR! portfolio-page#0.0.0 serve: `preact build && preact serve`
2018-10-21T09:09:28.617670+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-10-21T09:09:28.618022+00:00 app[web.1]: npm ERR!
2018-10-21T09:09:28.618469+00:00 app[web.1]: npm ERR! Failed at the portfolio-page#0.0.0 serve script.
2018-10-21T09:09:28.618707+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-10-21T09:09:28.639567+00:00 app[web.1]:
2018-10-21T09:09:28.639942+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-10-21T09:09:28.640124+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-10-21T09_09_28_621Z-debug.log
2018-10-21T09:09:29.383487+00:00 app[web.1]:
2018-10-21T09:09:29.383495+00:00 app[web.1]: > portfolio-page#0.0.0 dev /app
2018-10-21T09:09:29.383497+00:00 app[web.1]: > preact watch
2018-10-21T09:09:29.383498+00:00 app[web.1]:
2018-10-21T09:09:29.407743+00:00 app[web.1]: sh: 1: preact: not found
2018-10-21T09:09:29.430644+00:00 app[web.1]: npm ERR! file sh
2018-10-21T09:09:29.432029+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-21T09:09:29.433130+00:00 app[web.1]: npm ERR! errno ENOENT
2018-10-21T09:09:29.433981+00:00 app[web.1]: npm ERR! syscall spawn
2018-10-21T09:09:29.440231+00:00 app[web.1]: npm ERR! portfolio-page#0.0.0 dev: `preact watch`
2018-10-21T09:09:29.440955+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-10-21T09:09:29.442297+00:00 app[web.1]: npm ERR!
2018-10-21T09:09:29.442980+00:00 app[web.1]: npm ERR! Failed at the portfolio-page#0.0.0 dev script.
2018-10-21T09:09:29.443660+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-10-21T09:09:29.470864+00:00 app[web.1]:
2018-10-21T09:09:29.471185+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-10-21T09:09:29.471425+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-10-21T09_09_29_449Z-debug.log
2018-10-21T09:09:29.488189+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-21T09:09:29.489675+00:00 app[web.1]: npm ERR! errno 1
2018-10-21T09:09:29.497444+00:00 app[web.1]: npm ERR! portfolio-page#0.0.0 start: `if-env NODE_ENV='production' && npm run serve || npm run dev`
2018-10-21T09:09:29.497699+00:00 app[web.1]: npm ERR! Exit status 1
2018-10-21T09:09:29.498047+00:00 app[web.1]: npm ERR!
2018-10-21T09:09:29.498289+00:00 app[web.1]: npm ERR! Failed at the portfolio-page#0.0.0 start script.
2018-10-21T09:09:29.498516+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-10-21T09:09:29.517653+00:00 app[web.1]:
2018-10-21T09:09:29.521721+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-10-21T09:09:29.522301+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-10-21T09_09_29_507Z-debug.log
2018-10-21T09:09:29.630957+00:00 heroku[web.1]: State changed from starting to crashed
2018-10-21T09:09:29.608869+00:00 heroku[web.1]: Process exited with status 1
2018-10-21T09:09:31.210092+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=portfolio-page2.herokuapp.com request_id=e499628d-4990-47b8-9dbe-56cc75fe2a60 fwd="208.77.22.116" dyno= connect= service= status=503 bytes= protocol=https
2018-10-21T09:09:31.520483+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=portfolio-page2.herokuapp.com request_id=2a39f726-a35a-4356-96d5-4c2cde7661ca fwd="208.77.22.116" dyno= connect= service= status=503 bytes= protocol=https
I have no idea how to view the complete log(if its not the same as this), and I have preact in my dependancies.
{
"private": true,
"name": "portfolio-page",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"start": "if-env NODE_ENV='production' && npm run serve || npm run dev",
"build": "preact build",
"serve": "preact build && preact serve",
"dev": "preact watch",
"lint": "eslint src",
"styleguide": "styleguidist server",
"styleguide:build": "styleguidist build"
},
"eslintConfig": {
"extends": "eslint-config-synacor"
},
"eslintIgnore": [
"build/*"
],
"devDependencies": {
"eslint": "^4.9.0",
"eslint-config-synacor": "^2.0.2",
"preact-cli": "^2.0.1",
"react-styleguidist": "^6.1.0"
},
"dependencies": {
"if-env": "^1.0.4",
"preact": "^8.3.1",
"preact-compat": "^3.17.0",
"preact-router": "^2.5.7",
"react-fa": "^5.0.0",
"react-scripts": "^2.0.5",
"react-transition-group": "^2.2.1"
}
}
I'm sorry if this is too little or too much information, but I am relatively new to this and I have been working on this for a couple days. I would be grateful for some direction. On windows 10 using VScode.
It seems like dependencies npm install are not installed and you directly running npm start that why preact not found error occur.
Related
Having a few deployment issue here...
As my nodejs app in github is not in the root directory (its in a graphql dir), I added a top level .buildpacks file with the following content:
graphql=https://github.com/heroku/heroku-buildpack-nodejs.git
After I tried a build there was no sign of any dynos in my app so I added a top level Procfile with contents:
web: npm start
When I deployed again, now there does seem to be a dyno (it says 'This app is using free dynos' in the overview section), however the app is still goosed :
2022-07-06T11:44:06.316635+00:00 app[api]: Deploy 79e3037a by user x#gmail.com
2022-07-06T11:44:23.060054+00:00 heroku[web.1]: Starting process with command `npm start`
2022-07-06T11:44:25.159819+00:00 app[web.1]: npm ERR! code ENOENT
2022-07-06T11:44:25.160057+00:00 app[web.1]: npm ERR! syscall open
2022-07-06T11:44:25.160249+00:00 app[web.1]: npm ERR! path /app/package.json
2022-07-06T11:44:25.160789+00:00 app[web.1]: npm ERR! errno -2
2022-07-06T11:44:25.161801+00:00 app[web.1]: npm ERR! enoent ENOENT: no such file or directory, open '/app/package.json'
2022-07-06T11:44:25.161850+00:00 app[web.1]: npm ERR! enoent This is related to npm not being able to find a file.
2022-07-06T11:44:25.161892+00:00 app[web.1]: npm ERR! enoent
2022-07-06T11:44:25.163062+00:00 app[web.1]:
2022-07-06T11:44:25.163202+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2022-07-06T11:44:25.163233+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2022-07-06T11_44_25_124Z-debug-0.log
2022-07-06T11:44:25.378220+00:00 heroku[web.1]: State changed from starting to crashed
2022-07-06T11:44:25.299092+00:00 heroku[web.1]: Process exited with status 254
what am I missing?
First of all, I checked whole questions on stackoverflow and I can't find solution. When I try run my application by npm run dev, everything works. When I try to save something in VS Code (app crashed because something running on port 5000) then I have to change terminal, npx kill-port 5000 and npm run dev and over and over again.
require("dotenv").config();
const express = require("express");
const app = express();
const productRoutes = require("./routes/productRoutes");
const connectDB = require("./config/db");
const path = require("path");
if(process.env.NODE_ENV === 'production') {
app.use(express.static('../client/build'));
app.get('*', (req,res) => {
res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html'));
});
}
connectDB();
app.use(express.json());
app.get("/", (req, res) => {
res.json({ message: "API running..." });
});
app.use("/api/products", productRoutes);
const PORT = process.env.PORT || 5000;
app.listen(PORT, () => console.log(`Server running on port ${PORT}`));
Package.json
"scripts": {
"server": "nodemon backend/server.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"data:import": "node backend/seederScript",
"build": "cd client && npm run build",
"install-client": "cd client && npm install",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client",
"develop": "concurrently --kill-others-on-fail \"npm run server\" \"npm run start --prefix client\"",
"start": "concurrently --kill-others-on-fail \"npm run server\" \"npm run start --prefix client\""
},
When I try run heroku local, something running on that port already even though I killed the port
https://github.com/TomaszSygut/Shopping-cart
If someone know what's going on please help me. I already spent 2 days on that weird error
2021-06-23T12:12:46.000000+00:00 app[api]: Build started by user thomassygut#gmail.com
2021-06-23T12:14:54.513779+00:00 app[api]: Release v5 created by user thomassygut#gmail.com
2021-06-23T12:14:54.513779+00:00 app[api]: Deploy 9ceb0c19 by user thomassygut#gmail.com
2021-06-23T12:14:55.204758+00:00 heroku[web.1]: State changed from crashed to starting
2021-06-23T12:14:57.000000+00:00 app[api]: Build succeeded
2021-06-23T12:15:06.592623+00:00 heroku[web.1]: Starting process with command `npm start`
2021-06-23T12:15:09.222001+00:00 app[web.1]:
2021-06-23T12:15:09.222019+00:00 app[web.1]: > mern-shoppingcart-redux#1.0.0 start /app
2021-06-23T12:15:09.222020+00:00 app[web.1]: > concurrently --kill-others-on-fail "npm run server" "npm run start --prefix client"
2021-06-23T12:15:09.222020+00:00 app[web.1]:
2021-06-23T12:15:09.249330+00:00 app[web.1]: sh: 1: concurrently: not found
2021-06-23T12:15:09.252247+00:00 app[web.1]: npm ERR! file sh
2021-06-23T12:15:09.252540+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-06-23T12:15:09.252732+00:00 app[web.1]: npm ERR! errno ENOENT
2021-06-23T12:15:09.252908+00:00 app[web.1]: npm ERR! syscall spawn
2021-06-23T12:15:09.253986+00:00 app[web.1]: npm ERR! mern-shoppingcart-redux#1.0.0 start: `concurrently --kill-others-on-fail "npm run server" "npm run start --prefix client"`
2021-06-23T12:15:09.254100+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-06-23T12:15:09.254327+00:00 app[web.1]: npm ERR!
2021-06-23T12:15:09.254441+00:00 app[web.1]: npm ERR! Failed at the mern-shoppingcart-redux#1.0.0 start script.
2021-06-23T12:15:09.254573+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-23T12:15:09.263627+00:00 app[web.1]:
2021-06-23T12:15:09.263773+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-06-23T12:15:09.263872+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-06-23T12_15_09_255Z-debug.log
2021-06-23T12:15:09.344222+00:00 heroku[web.1]: Process exited with status 1
2021-06-23T12:15:09.410230+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-23T12:15:09.414393+00:00 heroku[web.1]: State changed from crashed to starting
2021-06-23T12:15:23.748088+00:00 heroku[web.1]: Starting process with command `npm start`
2021-06-23T12:15:26.383257+00:00 app[web.1]:
2021-06-23T12:15:26.383287+00:00 app[web.1]: > mern-shoppingcart-redux#1.0.0 start /app
2021-06-23T12:15:26.383288+00:00 app[web.1]: > concurrently --kill-others-on-fail "npm run server" "npm run start --prefix client"
2021-06-23T12:15:26.383289+00:00 app[web.1]:
2021-06-23T12:15:26.388074+00:00 app[web.1]: sh: 1: concurrently: not found
2021-06-23T12:15:26.394007+00:00 app[web.1]: npm ERR! file sh
2021-06-23T12:15:26.394493+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-06-23T12:15:26.394934+00:00 app[web.1]: npm ERR! errno ENOENT
2021-06-23T12:15:26.395258+00:00 app[web.1]: npm ERR! syscall spawn
2021-06-23T12:15:26.397033+00:00 app[web.1]: npm ERR! mern-shoppingcart-redux#1.0.0 start: `concurrently --kill-others-on-fail "npm run server" "npm run start --prefix client"`
2021-06-23T12:15:26.397313+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-06-23T12:15:26.397658+00:00 app[web.1]: npm ERR!
2021-06-23T12:15:26.397902+00:00 app[web.1]: npm ERR! Failed at the mern-shoppingcart-redux#1.0.0 start script.
2021-06-23T12:15:26.398179+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-23T12:15:26.407147+00:00 app[web.1]:
2021-06-23T12:15:26.407449+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-06-23T12:15:26.407673+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-06-23T12_15_26_400Z-debug.log
2021-06-23T12:15:26.468310+00:00 heroku[web.1]: Process exited with status 1
2021-06-23T12:15:26.643298+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-23T12:16:01.052036+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mini-shopping-app-demo.herokuapp.com request_id=c0f9a708-ddb7-4923-b5cc-b1b15fb61bca fwd="83.14.122.73" dyno= connect= service= status=503 bytes= protocol=https
2021-06-23T12:16:01.542494+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mini-shopping-app-demo.herokuapp.com request_id=f5e95ed2-5b89-4dbc-ac4c-0b3c582ae5d1 fwd="83.14.122.73" dyno= connect= service= status=503 bytes= protocol=https
2021-06-23T12:34:24.211883+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mini-shopping-app-demo.herokuapp.com request_id=36fe077b-9763-4056-86b7-228e9726f08a fwd="83.14.122.73" dyno= connect= service= status=503 bytes= protocol=https
2021-06-23T12:34:24.720272+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mini-shopping-app-demo.herokuapp.com request_id=ee3de3f0-fdd8-4978-9952-76b8f487c990 fwd="83.14.122.73" dyno= connect= service= status=503 bytes= protocol=https
I've deployed my bot's files but in the logs it says
2020-07-08T18:00:47.754261+00:00 app[web.1]: npm ERR! missing script: start
2020-07-08T18:00:47.762967+00:00 app[web.1]:
2020-07-08T18:00:47.763212+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-07-08T18:00:47.763312+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-07-08T18_00_47_755Z-debug.log
Heroku uses the start script, if no Procfile exists.
Useful links:
Procfile
Heroku Docs
npm docs
My application does not run in production. This is the code I am getting when reviewing the log.
2020-04-21T05:15:21.000000+00:00 app[api]: Build succeeded
2020-04-21T05:15:29.986534+00:00 app[web.1]:
2020-04-21T05:15:29.986552+00:00 app[web.1]: > webzm#0.1.0 start /app
2020-04-21T05:15:29.986553+00:00 app[web.1]: > node server.js
2020-04-21T05:15:29.986553+00:00 app[web.1]:
2020-04-21T05:15:32.860504+00:00 app[web.1]: [2020-04-21T05:15:32.860Z] error self signed certificate
2020-04-21T05:15:32.863444+00:00 app[web.1]: Error: self signed certificate
2020-04-21T05:15:32.863445+00:00 app[web.1]: at TLSSocket.onConnectSecure (_tls_wrap.js:1492:34)
2020-04-21T05:15:32.863446+00:00 app[web.1]: at TLSSocket.emit (events.js:315:20)
2020-04-21T05:15:32.863446+00:00 app[web.1]: at TLSSocket._finishInit (_tls_wrap.js:935:8)
2020-04-21T05:15:32.863446+00:00 app[web.1]: at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:693:12) {
2020-04-21T05:15:32.863447+00:00 app[web.1]: code: 'DEPTH_ZERO_SELF_SIGNED_CERT'
2020-04-21T05:15:32.863448+00:00 app[web.1]: }
2020-04-21T05:15:32.876901+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-04-21T05:15:32.877229+00:00 app[web.1]: npm ERR! errno 1
2020-04-21T05:15:32.878225+00:00 app[web.1]: npm ERR! webzm#0.1.0 start: `node server.js`
2020-04-21T05:15:32.878324+00:00 app[web.1]: npm ERR! Exit status 1
2020-04-21T05:15:32.878522+00:00 app[web.1]: npm ERR!
2020-04-21T05:15:32.878652+00:00 app[web.1]: npm ERR! Failed at the webzm#0.1.0 start script.
2020-04-21T05:15:32.878778+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Please see the following issue: https://github.com/strapi/strapi/issues/5696
An upstream package changed the way they validate self-signed certs that cause a failure.
im trying to push a mean stack project to heroku, but it wont start on heroku's server. it keeps giving me the following from the applications log:
2017-12-12T23:59:32.528690+00:00 app[web.1]: npm ERR! syscall spawn
2017-12-12T23:59:32.529607+00:00 app[web.1]: npm ERR! atl#0.0.0 start:
`ng serve`
2017-12-12T23:59:32.529706+00:00 app[web.1]: npm ERR! spawn ENOENT
2017-12-12T23:59:32.529925+00:00 app[web.1]: npm ERR!
2017-12-12T23:59:32.530127+00:00 app[web.1]: npm ERR! Failed at the
atl#0.0.0 start script.
2017-12-12T23:59:32.530306+00:00 app[web.1]: npm ERR! This is probably
not a problem with npm. There is likely additional logging output
above.
2017-12-12T23:59:32.535107+00:00 app[web.1]:
2017-12-12T23:59:32.535281+00:00 app[web.1]: npm ERR! A complete log
of this run can be found in:
2017-12-12T23:59:32.535429+00:00 app[web.1]: npm ERR!
/app/.npm/_logs/2017-12-12T23_59_32_531Z-debug.log
2017-12-12T23:59:32.626726+00:00 heroku[web.1]: State changed from
starting to crashed
2017-12-12T23:59:32.613442+00:00 heroku[web.1]: Process exited with
status 1
i don''t know where to look for this problem, please let me know if i need to upload any files to help with this error, thank you in advance.