Closed upkarlidder closed 4 years ago
You've caught us in between releasing the SDK major version and updating the docs. For now, take a look at the example at https://github.com/watson-developer-cloud/node-sdk/blob/master/README.md#visual-recognition that shoes the authentication
For reference, the affected Node version here is 8.10.
@SirSpidey, that is what I ended up doing. But I don't think other people make that connection and unfortunately just give up on the service. I am an IBMer at a hackathon. I expected the code example in the official API docs to work without having to dig into the SDK source :(. It is also concerning that the examples between API docs and the SDK Github docs are different. Thank you for your attention to this.
@SirSpidey This is a bug in the front matter for the Node SDK in that it does not specify the version of the Node SDK -- unlike all the other languages. We need to update the Node front-matter to change:
npm install ibm-watson
to something like:
npm install ibm-watson@^4.0.0
While we're at it, we should throw in '--save', so that it adds the dependency to the application's package.json. So I recommend that the front-matter update for the new major release should be
npm install --save ibm-watson@^5.0.0
While we're at it, we should throw in '--save', so that it adds the dependency to the application's package.json
Since NPM 5, that's the default behavior unless specified otherwise via flags or editing your .npmrc
.
@mkistler Got it. Will update the front matter for the install command. Yes, we just removed the --save
option.
This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@SirSpidey was this fixed?
Yes. install is now in this format npm install ibm-watson@^5.2.0
.
Overview The code for Node.js from the API docs does not work.
I get the following error:
Expected behavior Expected the code in API docs to work without throwing the error. I got it working with the following code
Actual behavior Get error
How to reproduce Copy paste the code from the Node.js API docs.
Screenshots N/A
SDK Version
const VisualRecognitionV3 = require('ibm-watson/visual-recognition/v3');
Additional information:
Node version v11.14.0
Additional context Ran into this error at a hackathon. The Python code works as it is. Node.js does not.