Closed ghost closed 6 years ago
yeah I've noticed that too can't remember what the solution is, I'll look into it.
here is something I have that has worked for me: (Lines 87-92) secret-hitler\node-modules\mongodb\lib\url_parser.js (only line 90 is different from what is made. I think you don't get this folder until u run npm commands; not default in master ... but here:
for(i = 0; i < hosts.length; i++) { var r = parser.parse(f('mongodb://%s', hosts[i].trim())); if(r.path && r.path.indexOf(':') != -1) { hosts[i]='localhost:27017/secret-hitler-app'; } }
Do you have a .env file with
MONGOPORT=27017
in it?
But I think the real problem is that when u run on localhost u have ur IP listed as ::1 when it should only be :1 but i dont know how to make the extra colon go away. This code above overrides the error and allows u to run nodemon bin/dev in cmd without crashing...
yes I do
this is saved to the default file where the big master file is saved that is cloned also in cmd npm
there's an easy fix that's beyond me at the moment. I'll look into it at home in ~8 hours..
Also there a lot of weird npm warn deprecation warnings that pop throughout the process as well that seem weird like u cannot have stuff updated properly or something... I don't know if this is my problem only or if anyone who wants to test code locally suffers from these too?? and when u run gulp it says "Failed with 11 errors" and lists where they are.... not sure if any of these are big enough issues to tackle or if there is even a way or if there is a way I need to personally update.. idk & Thanks for looking into that!
The deprecation things is dependencies having deprecations, which is nothing we can do about or worry about so ignore it. The gulp warnings/errors are eslint failures.. this is complicated but the gist of it is eslint and prettier conflict in some ways and basically eslint just needs to be told to shut up. They are not code failures so to speak, they are formatting failures.
What I have done before with the gulp issues is go into the files it wants changed a certain way and I make the revisions regardless how silly they seem just to remove the failure notice for personal satisfaction. I can make a PR with those changes so it can be this way all the time in master here if u like... but yeah on deprecations ok thx ;)
also here are some screenshots with running the stuff (later times after initial set up):
just so u know what it looks like for me subsequent times after initial set up. Also for nodemon bin/dev pages at the end after brief time i got a new red warning: Port 8080 is already in use [nodemon] app crashed - waiting for file changes before starting... not sure why that is happening either..?
here im gonna reclone from step 1 following readme instructions on here and show u what everything does via screenshots:
First npm window prior to anything after npm run db 27017:
Second npm window just for just nodemon bin/dev:
Next I implement my fix to this code error in the above image in IntelliJ IDEA IDE 2017.3: first current code: now new edit for line 90 in this section:
After doing this I go back to nodemon bin/dev page and rerun the command:
Last page: gulp command:
After running at least nodemon bin/dev if not also gulp, the very first npm window of npm run db 27017 changes slightly by adding more info at the bottom: here is that view
Now localhost:8080 navigation: Home Page: Game Page: After making a 'coz' account and clicking changelog i sent test chat as well: (i guess name doesn't turn red until u play 50+ games or change wins to 50+ (either way), right?)
But yeah so this is everything i think.
Now I will close all these windows and insert my PRs that I have on here into my local code and show u how it runs especially with gulp eslint stuff:
First npm window: just cd s-h and then npm run db 27017:
Second npm window: cd s-h and then nodemon bin/dev: (SO apparently one of my "fixes" for eslint is bad as this error is new....) Now having revised this issue, I will now rerun the command to have this window work right: (SO it is so awesome I did not have to physically rerun anything it fixed this page when I fixed code. SO one error I think will remain in next window for gulp eslint.)
Gulp 3rd npm window: (SO again one of my "fixes" caused a new weird problem, but it also does not seem to actually crash this from working....)
After doing this, I decided to try and fix the code that was messed up but this happened:
I was about to revise the code again but then this popped up at the bottom after Failure notice:
anywho.... that part is new weird problem... but then i revised code and rerun gulp for 3rd time with this result: so 2 out of the original 10/11 errors are left unable to be fixed so I need to revise my PR
I think the segment highlighted here always comes super late at the end of gulp even when no fail errors take place... im not sure what the issue with it is.....
First window again with small add ons:
Now localhost:8080 /observe coz logged in and one chat sent:
theres that. take a look and let me know what u think
also if there is ever a time u need to do a down low test not in production mode I recommend using the following: This is in Git Bash .exe not regular cmd or even npm cmd. U then could use {computerName}:8080, localhost:8080, and https://secrethitler.localtunnel.me to test in dev mode and use the localtunnel link to send to preferred helpful people testers outside of your IP via discord link send out, etc..
U would run this after u do the 3 npm cmds for db 27017, nodemon bin/dev & gulp commands.... so 4 windows of running commands, one IDE analyzing code window for local edits, and then browser to run dev or production modes in as well as edit things on github and chat with discord for a great SH.IO set up ;)
@cozuya I found out my problem: I was not moving the .env file from my actual root directory Users\natha into the \secret-hitler directory. Once I did this my problems with double colon ceased. In a new PR I just opened a couple mins ago to aid the confusion in README I addressed this by adding a clear step for others who might get stuck on this as well.... I also found only one new gulp eslint error which i have fixed regarding an extra space before a comma that is unneeded, and I also made yet another PR for the page-home.pug to match the Changelog.jsx file.
The way the code currently stands is that when you run on npm node.js to test code that there is a difficult piece that pops up in node_modules url_parser.js line 90 regarding double colon error in host IP or something like that during the nodemon bin/dev line portion, something you have to change each new git clone command run set up you do.. can be a bit of a hassle for coders as well as other development errors that occur with npm rather than code during testing and working on issues to improve site functions...