last day (14 days later) » 
00:00 - 02:0002:00 - 15:00

12:51 AM
0
Q: Site works locally / Not on Openshift

ewizardI am creating a forum with Angular - it interfaces with Node/Mongo, so there are plenty of requests that need to be executed to fill the page with the required data. Everything works exactly as it should locally, but when I upload to Openshift...the site seems to be very buggy, and it doesn't see...

 
I just updated angular in the seed - gonna see if that helps...
 
you do realise the complexity of your question? Have yo nailed it down to 1 area ? Debug more is my advice!!!
 
@Pogrindis it works locally - im on openshift irc to see if they can help - but nobody has responded - its weird and i dont know what to do to debug...if u have any ideas...
 
so... then its enviormental.. what are the conditions ? hows that package.json doing ? ensureing oure --save everything ? anything ?~!
 
@Pogrindis the conditions are above
@Pogrindis where it says - /lib/config/express.js
@Pogrindis i havent been using --save..should i?
 
12:51 AM
what about running 'DEV' on the server ? its working then ?
if you're adding packages you should use --save onthe install, it will then addit to the packages
 
@Pogrindis no - it falls apart...ill check out the package.json
@Pogrindis didnt add any packages that werent already with the seed...
 
fair enough, are you getting any sort of error mesages ??
 
@Pogrindis i notice its running express 4 the newest version...could this be a problem for openshift?
@Pogrindis no - the requests just dont happen...like the code isnt being run...again - everything works fine locally though
package.json:
{
"name": "app",
"version": "0.0.0",
"dependencies": {
"express": "~4.0.0",
"morgan": "~1.0.0",
"body-parser": "~1.0.0",
"method-override": "~1.0.0",
"static-favicon": "~1.0.1",
"cookie-parser": "~1.0.1",
"express-session": "~1.0.2",
"errorhandler": "~1.0.0",
"compression": "~1.0.1",
"lodash": "~2.4.1",
"mongoose": "~3.8.8",
"connect-mongo": "mrzepinski/connect-mongo#2135988",
"passport": "~0.2.0",
"passport-local": "~0.1.6",
"ejs": "~0.8.4"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-autoprefixer": "~0.4.0",
 
hi mna
man
 
i also updated angular...and the angular resource package needed to be updated...so that happened..but it didnt help the problem
hey dude
 
12:52 AM
ok so you're in a good position
its working in A and not in B
 
yup
 
what changed along the way
 
the only thing i change
to make it go from dev
to production
is that line in my stack question
the one with "development" or "production"
 
i understand that
 
than in that express.js file
it runs accordingly
all the stuff
something in there has to be messing it up...also what about grunt build? it minifys things
 
12:54 AM
but are you killing exceptions in your dev env that your not in prod ?
also make sure you check versions
node is very prone to problems with versioning
 
ok
so
 
jo
 
this is development.js
 
+1
 
'use strict';

module.exports = {
env: 'development',
mongo: {
uri: 'mongodb:///tmp/mongodb-27017.sock/app'
}
};
this is production.js
'use strict';

module.exports = {
env: 'production',
ip: process.env.OPENSHIFT_NODEJS_IP ||
process.env.IP ||
'0.0.0.0',
port: process.env.OPENSHIFT_NODEJS_PORT ||
process.env.PORT ||
8080,
mongo: {
uri: process.env.MONGOLAB_URI ||
process.env.MONGOHQ_URL ||
process.env.OPENSHIFT_MONGODB_DB_URL+process.env.OPENSHIFT_APP_NAME ||
'mongodb:///tmp/mongodb-27017.sock/app'
}
};
 
12:55 AM
your requires are all that matters
the dependancies
you wouldnt fail beased on your code
its a library issue
 
yah
 
90 sure
 
thats what i think
so what do u suggest exactly?
 
so we need to see what the versioning is
 
ok
 
12:56 AM
its painful
 
i think it is 0.10.25 on openshift
for node
 
but you're going to have to see locally what versions you're running
and compare them to the server
 
i think i saw that
ahhh
 
unfortunately its not any black magic
 
v0.10.26 locally
ok
so that might be the problem
i think the server runs .25
let me check ill ssh in
 
12:58 AM
it's happened to me more than i'd like to admit
 
yup ur right about the version mismatch
v0.10.25
on server
what should i do?
 
i might still be wrong
 
just downgrade my node?
 
you CAN revert the version
i had to do it...
 
and then upload?
 
12:59 AM
but i googled ....
 
on openshift?
 
well no
i removed --purge node
purge will remove settings
then you can google how to find how to install a specific version
 
u mean on my machine though?
 
extra param on the npm
well
 
yah - i gotcha
 
1:00 AM
your machine is working
 
yup
 
so you have 2 options
upgrade your local to latest and fix it
or you could work with older
 
local is latest...server is older
i would need to update the server
 
versioning on npm is painfull man..
 
in that scenario
yah - ive never run into this
 
1:02 AM
but you have an idea where to look for the solution ?
im glad i was here for your first then! ^^
 
yah i guess..google something like "match local node with openshift node version"?
lol
 
why are you using open shift ?
 
tell me exactly wat to google lol - and then ill be good
cuz its free haha
looked all over for other free ones...couldnt really find any where u could have a database too
 
i have never come across it before thats why i ask!
let me check what its doing , otherwise you want "nodejs specific version install "
"npm specific version install "
 
and i would want to do the same version on my machine as the server
is how ur saying to go about it
 
1:05 AM
or
well
you should have a versioning system setup
 
so downgrade from 26 to 25
 
well check the repo and see if its applicable
like i said it all depends on your requirements
but keep a versioning system
 
this what ur talking about?
 
well yeah
 
3
Q: Downgrade NodeJs Version and express version

theintersectCurrently I am working on a nodejs project. I have installed Express 3.X which is in alpha stage, and my node version is also at 0.7.2-pre. I am currently trying to downgrade my express version, via npm, but it seems that i have to downgrade my node version as well. What is the best way to achie...

 
1:06 AM
you've just hit the problem
think why there is a version on the package.json
 
to match with server
 
nope
thats only on a buld system
 
why?
it just installs that version i know that much
 
because javascript is not strongly typed... you can literally write what you like..
its horible.. but at the same time its itself so you have to appreciate that
 
haha ... i dont follow i guess...u clearly know more than me
 
1:08 AM
it installs the latest version unless you specify! :)
 
ahhhh
 
i guess thats your answer
 
so change that
to 0.10.25?
 
exactly, you want to specify a version
 
the same as server version?
ahhh ok
 
1:09 AM
or at least a range of versions
 
then i will reupload as if i hadnt done anything...and it will reinstall it to the correct version
 
anything before V5
 
i see
let me try
 
once you give versions!
same as on you rloval
local*
sorry im kinda drunk
 
ahh so i have to downgrade locally too
 
1:11 AM
listen
when working with node version matters.
 
haha nice
so im looking at this...and i dont have nvm installed...what is that?
oh node version manager lol
 
doesnt matter how nice your code is, if some asshole decided that function is gone on a minor version, you're screwed
;] yeas nvm
was build to make life that LITTLE bit easier! ;]
 
cool - curling nvm now
 
+1 welcome to the non-strong typed wolrd of dev
 
i just installed nvm but it still isnt recognizing the command
reopened console too
 
1:14 AM
check your globals, you on linyus ?
 
oh yah
yah i am
hmmm it put in my .bash_profile export NVM_DIR="/home/yz/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
 
you're prob gonna have to hit node first, its a sub of node, so node nvm
 
node nvm

module.js:340
throw err;
^
Error: Cannot find module '/home/yz/.nvm/nvm'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
oh wait
 
its a mess! :) But
 
there is an install script in the .nvm folder
 
1:16 AM
h i am
hmmm it put in my .bash_profile export NVM_DIR="/home/yz/.nvm"
undoo that
 
should i run that?
 
yeah
 
=> nvm is already installed in /home/yz/.nvm, trying to update
has to be a path thing
 
whereis that shit
it should be a path already
 
/home/myusername/.nvm
same as what it says in bash_profile
do i have to do anything to refresh something so it will recognize the command?
 
1:18 AM
no
you doing whereis recognises
hit npm
and what comes out
'npm --h'
 
npm@1.4.7 /usr/lib/node_modules/npm
 
nvm
sorry
 
haha knew it wasnt gonna work: bash: nvm: command not found
oh ok
its not finding it..is my path stuff located anywhere else other than bash_profile?
 
wait
let me check
im almost sure its a sub of node
but i could be wrong
1 sec
 
kk thanks for your help!
oh wait...i think i see it - needed to add params for a global install of nvm i think
 
1:21 AM
hmm
you compiled it froum source ?
ok ok
im kinda drunk, and i need to leave soon! BUT! What version of nix you on |?
debian ?
 
kali
haha
 
if you turn around and say bsd ill be upset! :D
oh
afaik kali is debian based
 
word
yah i knew that
 
read hist script
its pretty good... i STRONGLY reccomend you read through it before executing to makre sure!
 
ok - i copied it into the install script...ill read through it
 
1:26 AM
read it before executing
 
yah looks good
 
because it does grab a lot external
i wish i could stick around and give you a hand!
 
how would i remove nvm...the one i installed?
 
is there a PM system on stack ?
the one you installed
if there is a primary as apposed to a user defined
by default it will be overwritten
 
no there isnt a message system unfortunately...wish there was
 
1:28 AM
however as you said
there is no command nvm for you right now
so its fine...
 
yah - but it still installed the files
and i copied in ur install script...and ran it...and it said already installed
 
ah, interesting..
 
my console is just being dumb and not recognizing the nvm command lol
 
did it say what was installed ?
 
should i restart?
 
1:29 AM
computer is never wrong
no
 
=> nvm is already installed in /home/yz/.nvm, trying to update
 
that looks like what was manually defined
 
that is where the install script is...it wouldnt have been there if i didnt install it with the curl...i think the curl ran it automatically though
 
remove all references!
 
so i want to uninstall and reinstall with ur script
 
1:29 AM
good idea
but remove
all the ref to the manual insert
 
where exactly?
 
well, the global YOU put in for nvm
you wanna remove that rimarily
 
i didnt do it lol...the install script did
ok
 
primarily
nvm is already installed in /home/yz/.nvm, trying to update
thats suspiciously the same as the old
hmmm i didnt think nvm would be so hard to install
and at the same time nvm is only going to be used to control versions
write a version file
make your build system read from it and parse.
multiple will then be easier, just keep track of NPM versions in them
thats a worst case scenerio
 
i got it
did manual install
installing node 25 now
 
1:36 AM
;[]
 
i just delete .nvm folder...removed references...and cloned the repo
and then had to do a few things
 
ok
 
but its recognized now
ok cool
it says
 
everthing here im writing almost a theseis
 
Now using node v0.10.25
 
1:36 AM
but your question was a good one
 
haha thanks
thanks alot for your help
so now i just change package.json...re build with grunt and upload?
 
well
 
oh wait..gotta make it npm install everything
ok i got this
 
yea ;]
your package needs to have the right version though
 
yah i did that
 
1:37 AM
ossum
 
"engines": {
"node": "0.10.25"
},
 
;]
 
ok upload in progress...ill let u know if it helped...crossing my fingers
the symptoms my site is having seem like the ones that would come with version problems correct?
 
:)
im still digesting the results of your labour into an answer
need to cover all angles
 
lol
 
1:42 AM
you raised a good question thoug in fairness
 
nice...im hoping it works
thanks
yah - my first versioning problem for sure
 
lel
can i ask where yo might be from ?
 
boston ma
 
as a sidebar ofc! :D
 
us
 
1:43 AM
ossm
 
u?
 
\im irish
 
nice
haha my name is Eamon
 
boston might aswell be irish in crtain places
 
named after the president of the republic of ireland from the 70's
 
1:44 AM
eamon i THINK is irish
;]
 
and a lacrosse player
 
;))
 
grandfather on my dad's side is irish
 
well you have persistance ill give you that!
 
haha thanks
yah - i have trouble dropping shit when it comes to computer problems...just go go go
haha
 
1:46 AM
;] you have some attitude though
ive met too many people who jst say 'fuck it]'
you're actually looking to do it, thats what i like
 
i hear ya man - those people suck lol
thanks for the kind words
just find computers to be interesting as fuck basically lol
if im interested in something...i go hard
 
whatever you do, keep it up, i have never had someone persist the question
 
haha thanks
 
you have brought on about 3 topics
in 1 question
its a good one
 
haha thanks
 
1:50 AM
what you do for work ?
 
was hoping to god someone would take the time to read it all lol - enter you!
im just freelance webdev now
got an email from some company today actuallyu
so hopefully that works
off of careers 2.0 actually
they need someone who knows MEAN
and i think i know it pretty well now
 
hmmi have a good friend in NY who is working quite heavy in app dev, initially it was a lot of c++ but the engin is drawn
te asshole set up his own comp
sorry he's not an asshole at all
 
one of my projects is a one click game website/app thing
we are using flash
 
hmm
would you replace flash ?
 
yah we def thought about it
we are aware of the apple vs adobe feud
which makes flash lame in a way
 
1:52 AM
no no no
 
but we figured out how to port it for iOS
so we arent too worried
just doing the project for some cash for a friend of a friend
 
agreed
i hate apple
but flash is hard to work with
i find anyway
 
actionscript is fairly straight forward i think
ive been messing with some of the frameworks
the game dev ones starling, feathers
we need to make a sample game for this guy
we are making the one click helicopter game lol
pretty much done with it..its obvi easy to write
a simple game like that
meanwhile..the update is done
im gonna check out the site
 
;]
 
one sec
just have to rename the logo on the server...annoying production path thing...just did it - restarting the openshift cartridge
oh no!!!! it didnt help lol
its still not working
it has to be something with express maybe...anyway...uve been helpful with the version stuff...im gonna double check all of it
it has to be something environment related
 
1:58 AM
whats the errpor ?
error ?
 
no error
its just still not doing the requests
like it does locally
requests to mongo
 
wth no response ?
you have mongo on server ?
 
yah
 
these things will ALWAYS throw eroors
 
ive gone into the console
should i look at mongo log?
 
00:00 - 02:0002:00 - 15:00

last day (14 days later) »