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

Bump ibm-watson dependency #504

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johnwalicki
Copy link
Contributor

Bump ibm-watson dependency (and its version of axios 1.x) so that node-red-node-watson works on newer versions of Node.js

I ran into a similar "MODULE_NOT_FOUND" as described here
https://discourse.nodered.org/t/need-help-with-why-i-cant-install-a-node-node-red-node-watson/82916/3
when I tried to run some of my older Node-RED flows on Node-RED 4.0.5

The Node-RED log reports errors for each of the node-red-node-watson nodes:

[warn] [node-red-node-watson/watson-speech-to-text-v1] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/defaults' is not defined by "exports" in /opt/app-root/data/node_modules/axios/package.json

Even though node-red-node-watson 0.10.3 does not directly have a dependency on axios, the underlying ibm-watson package does. From the node-red-node-watson package.json

    "ibm-watson": "^6.2.2",

That ibm-watson version pulls in the older axios "0.26.0" which seems to no longer work with newer versions of Node.js

Fixed by forking https://github.com/watson-developer-cloud/node-red-node-watson
to https://github.com/johnwalicki/node-red-node-watson/
I added one commit (this PR) to bump the ibm-watson dependency
Bump ibm-watson to ^9.1.0
which pulls in axios 1.7.* and now all of the node-red-node-watson nodes work on Node.js 20

How did I test it:
Node-RED 4.0.5 running in a container,
with my flow with a package.json which points temporarily at my branch

        "node-red-node-watson": "github:johnwalicki/node-red-node-watson.git#bump-ibm-watson"

I tested this patched node-red-node-watson with the newer ibm-watson 9.1.0 successfully on Node.js v16, v18, v20
I did not bump any other dependencies.

Bump ibm-watson dependency (and its version of axios 1.x) so that node-red-node-watson works on newer versions of Node.js
@johnwalicki
Copy link
Contributor Author

@chughts For your consideration and review.

@johnwalicki
Copy link
Contributor Author

johnwalicki commented Oct 28, 2024

This discourse conversation was also a clue.
https://discourse.nodered.org/t/stuck-with-text-to-speech-watson-node/81211

@johnwalicki
Copy link
Contributor Author

The rabbit hole was deep as I tried to determine why axios versions were affecting node-red-node-watson (which doesn't have a direct dependency on axios)
axios/axios#5072

@johnwalicki
Copy link
Contributor Author

The final clue was a comment here
https://stackoverflow.com/questions/75642251/using-require-axios-and-vrchat-i-get-error-err-package-path-not-exported-pa
which said:

This error usually occurs when there is a mismatch between the version of the axios package and the version of Node.js being used.

@chughts
Copy link
Member

chughts commented Oct 28, 2024

Thanks @johnwalicki I'll publish to npm in the next few hours.

@chughts
Copy link
Member

chughts commented Oct 28, 2024

or at least after the merge runs, and I can bump the version.

@chughts
Copy link
Member

chughts commented Oct 28, 2024

@jjasghar @ibm-reaper could you please either:

Fix the codify/pr dependency on this repository, so it is triggered and reported correctly

or

Grant me admin access to this repository, so I can accept this pull request.

@johnwalicki
Copy link
Contributor Author

johnwalicki commented Oct 28, 2024

Thanks @chughts for the review.

FWIW - the ibm-watson axios dependency was bumped in ibm-cloud-sdk-core a few months ago.

@chughts
Copy link
Member

chughts commented Oct 29, 2024

@mseul-ibm I would like to accept this pull-request, bump the version and publish to npm, but I am prevented by a broken codacy dependency. Could you please fix this, or give me admin access so that I can.

@chughts
Copy link
Member

chughts commented Oct 30, 2024

@johnwalicki published to npm as 0.10.4 though had to fork to https://github.com/ibm-early-programs/node-red-node-watson to do so.

Please close this pull request. I will open a new one, with the bump / version change, though it is looking likely that I may need to find a new permanent home for this repository.

@johnwalicki
Copy link
Contributor Author

Thanks @chughts - The new release looks good.

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

Successfully merging this pull request may close these issues.

2 participants