watson-developer-cloud / node-sdk

:comet: Node.js library to access IBM Watson services.
https://www.npmjs.com/package/ibm-watson
Apache License 2.0
1.48k stars 670 forks source link

File called "string" created on startup #56

Closed cfjedimaster closed 9 years ago

cfjedimaster commented 9 years ago

I noticed my node app was creating a file called "string" with the contents: testtest

I narrowed it down to the init portion of this library:

var visual_recognition = watson.visual_recognition({ username: 'stuff', password: 'more stuff', version: 'v1' });

germanattanasio commented 9 years ago

@cfjedimaster We don't create files in the wrapper/library. Are you using the sample app?

cfjedimaster commented 9 years ago

Nope. I'm using this: https://github.com/cfjedimaster/IonicBluemixDemo

I basically commented out more and more of my app.js file and narrowed it down to that part.

nfriedly commented 9 years ago

So, I just made all fs.write* functions log a stack trace, and it looks like it's coming from this: https://github.com/jprichardson/string.js/blob/master/lib/string.js#L726 which is in one of the watson-developer-cloud dependencies. I'm not exactly sure what they're trying to do there, but I don't think they're doing it, so I'm going to file a bug on that repo and link to this one.

cfjedimaster commented 9 years ago

Muchas gracias.

On Wed, Aug 5, 2015 at 1:06 PM, Nathan Friedly notifications@github.com wrote:

So, I just made all fs.write* functions log a stack trace, and it looks like it's coming from this: https://github.com/jprichardson/string.js/blob/master/lib/string.js#L726 which is in one of the watson-developer-cloud dependencies. I'm not exactly sure what they're trying to do there, but I don't think they're doing it, so I'm going to file a bug on that repo and link to this one.

— Reply to this email directly or view it on GitHub https://github.com/watson-developer-cloud/nodejs-wrapper/issues/56#issuecomment-128094205 .

Raymond Camden, Developer Advocate for MobileFirst at IBM

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: raymondcamden

germanattanasio commented 9 years ago

Thanks @nfriedly, lets keep this bug open until they fix it.

jsstylos commented 9 years ago

Nice debugging @nfriedly! Thanks for the report, @cfjedimaster.

nfriedly commented 9 years ago

BTW, since @jsstylos asked about it, this is the code to make all fs.write* methods log a stack trace: https://gist.github.com/nfriedly/5813c0fcea944f05ccfe

nfriedly commented 9 years ago

So, it looks like this is a bug in the interaction between shelljs and string.js - https://github.com/cfjedimaster/IonicBluemixDemo/pull/1 has a simple workaround of just loading string.js first (you'll have to delete node_modules and reinstall though, I moved string.js to a top-tier dependency to make it work.)

cfjedimaster commented 9 years ago

Wow, you certainly didn't need to file a PR to fix it for me on my side too. Thank you. :)

On Wed, Aug 5, 2015 at 1:40 PM, Nathan Friedly notifications@github.com wrote:

So, it looks like this is a bug in the interaction between shelljs and string.js - cfjedimaster/IonicBluemixDemo#1 https://github.com/cfjedimaster/IonicBluemixDemo/pull/1 has a simple workaround of just loading string.js first (you'll have to delete node_modules and reinstall though, I moved string.js to a top-tier dependency to make it work.)

— Reply to this email directly or view it on GitHub https://github.com/watson-developer-cloud/nodejs-wrapper/issues/56#issuecomment-128103710 .

Raymond Camden, Developer Advocate for MobileFirst at IBM

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: raymondcamden

nfriedly commented 9 years ago

Yea, it looks like they're adding a workaround to string.js so you can just ignore that PR. I mostly did it to see if that was indeed the issue. And then since I already did the work, I figured I might as well make it available ;)

az7arul commented 9 years ago

@germanattanasio its fixed in 3.3.1 of string.js

germanattanasio commented 9 years ago

thanks @az7arul!