Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error (Heroku) #15

Closed
AYMENJD opened this issue May 23, 2020 · 17 comments
Closed

Error (Heroku) #15

AYMENJD opened this issue May 23, 2020 · 17 comments

Comments

@AYMENJD
Copy link

AYMENJD commented May 23, 2020

Hello i got error application when i deploy your project on heroku please fix it http://yt-search-me.herokuapp.com/api/search?q=aymen&page=1

@HermanFassett
Copy link
Owner

Can you give me the logs? It works fine on my deploy so this sounds like an issue with how it's set up.

@AYMENJD
Copy link
Author

AYMENJD commented May 24, 2020

I just fork and deploy it on here the logs says :
2020-05-24T02:21:02.882582+00:00 app[web.1]: > youtube-scrape@0.0.3 start /app2020-05-24T02:21:02.882583+00:00 app[web.1]: > node server.js2020-05-24T02:21:02.882583+00:00 app[web.1]: 2020-05-24T02:21:02.934470+00:00 app[web.1]: internal/modules/cjs/loader.js:9602020-05-24T02:21:02.934472+00:00 app[web.1]: throw err;2020-05-24T02:21:02.934473+00:00 app[web.1]: ^2020-05-24T02:21:02.934474+00:00 app[web.1]: 2020-05-24T02:21:02.934474+00:00 app[web.1]: Error: Cannot find module 'express'2020-05-24T02:21:02.934474+00:00 app[web.1]: Require stack:2020-05-24T02:21:02.934475+00:00 app[web.1]: - /app/server.js2020-05-24T02:21:02.934475+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)2020-05-24T02:21:02.934476+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:840:27)2020-05-24T02:21:02.934476+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:1019:19)2020-05-24T02:21:02.934476+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:77:18)2020-05-24T02:21:02.934477+00:00 app[web.1]: at Object. (/app/server.js:1:17)2020-05-24T02:21:02.934477+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1133:30)2020-05-24T02:21:02.934478+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)2020-05-24T02:21:02.934478+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:977:32)2020-05-24T02:21:02.934478+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:877:14)2020-05-24T02:21:02.934479+00:00 app[web.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {2020-05-24T02:21:02.934480+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',2020-05-24T02:21:02.934483+00:00 app[web.1]: requireStack: [ '/app/server.js' ]2020-05-24T02:21:02.934483+00:00 app[web.1]: }2020-05-24T02:21:02.940250+00:00 app[web.1]: npm ERR! code ELIFECYCLE2020-05-24T02:21:02.940535+00:00 app[web.1]: npm ERR! errno 12020-05-24T02:21:02.941637+00:00 app[web.1]: npm ERR! youtube-scrape@0.0.3 start: node server.js2020-05-24T02:21:02.941744+00:00 app[web.1]: npm ERR! Exit status 12020-05-24T02:21:02.941905+00:00 app[web.1]: npm ERR! 2020-05-24T02:21:02.942035+00:00 app[web.1]: npm ERR! Failed at the youtube-scrape@0.0.3 start script.2020-05-24T02:21:02.942128+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.2020-05-24T02:21:02.947243+00:00 app[web.1]: 2020-05-24T02:21:02.947393+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:2020-05-24T02:21:02.947456+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-05-24T02_21_02_942Z-debug.log

@AYMENJD
Copy link
Author

AYMENJD commented Jun 11, 2020

Hello?

@HermanFassett
Copy link
Owner

I was able to redeploy the current code and it worked fine. My setup is a simple heroku nodejs app with a port defined in config vars but that should be handled in server.js already. Module not found makes it sound like the package.json file is missing the list of packages.

@AYMENJD
Copy link
Author

AYMENJD commented Jun 11, 2020

Okay then make deploy to heroku button to README file ?

@AYMENJD
Copy link
Author

AYMENJD commented Jun 23, 2020

Can u just create new account on heroku and try to deploy ??? I don't know why it's not working only i click to deploy button and i don't modify any file 💔

@HermanFassett
Copy link
Owner

Hmm, I used my existing account and clicked deploy to new app which worked fine:
https://testgh-ytscrape.herokuapp.com/
I can try on a new account later I guess.

@AYMENJD
Copy link
Author

AYMENJD commented Jun 23, 2020

Wtf? See https://zzzau.herokuapp.com/api/search?q=herman%20fassett&page=1 i deploy it now

@andrewstech
Copy link
Contributor

Its working for me.

@AYMENJD
Copy link
Author

AYMENJD commented Jun 23, 2020

Do u add any thing to Config Vars in heroku?

@HermanFassett
Copy link
Owner

All I did was click the Deploy button in the readme, login with my account, type in an app name, then click Deploy app. It then built and deployed successfully and gave me deployed url.

@AYMENJD
Copy link
Author

AYMENJD commented Jun 24, 2020

I swear am doing like u and i get error

@AYMENJD
Copy link
Author

AYMENJD commented Jul 5, 2020

@HermanFassett
Copy link
Owner

Have you tried with the latest code changes? If not, can you try with some of those solutions on your own fork and merge with a pull request if you get it working? I could do it myself, but since it's working for me I wouldn't know what works

@vicwomg
Copy link

vicwomg commented Jul 26, 2020

I had this issue as well. Very puzzling, the node_modules get pruned away during one of the build steps. Something like "pruning Dev dependencies". However, the project's package.json doesn't specify any devDependencies. I feel like it's a heroku default configuration issue on certain account setups.

Adding this config fixed it:
NPM_CONFIG_PRODUCTION=false

From the cli:
heroku config:set NPM_CONFIG_PRODUCTION=false -a <your_deploy_name>

See: https://devcenter.heroku.com/articles/nodejs-support#package-installation

@HermanFassett
Copy link
Owner

@ryzahramakeup do you see similar issues in complete logs like aymen?

@HermanFassett
Copy link
Owner

I've seen the same issue in heroku deploy now and adding the config as @vicwomg commented fixed it. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@vicwomg @HermanFassett @andrewstech @AYMENJD and others