You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is difficult to reproduce since it's happening when using internal packages that are published to an internal npm repository. So I'm coming up with my own way to reproduce the error based on what I think is going wrong. Might not be the best way.
NCU fails to fetch the information for the package and throws an unhandled error. The current workaround for me is to just skip checking for that package but this should be handled in a cleaner way. Seems to have something to do with the name.
Steps:
Add a package that contains no npm repo such as: "@me/fake-package-from-me": "1.0" to your package.json
run: ncu
Current Behavior
Throws the following error and does no updates
[===-----------------] 4/29 13%Mk: 400 Bad Request - GET http://240.10.0.1:36339/ws/16nowkfxgqqsb476bdqdl1io8pmpr7c0/uyuzgck3/npm/%40me%2Ffake-package-from-me - Bad request. The package name '@me' is invalid.
at /local/home/vmagachr/.local/share/mise/installs/node/18.18.2/lib/node_modules/npm-check-updates/build/index.js:347:974
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
headers: [Object: null prototype] {
'content-type': [ 'application/json' ],
'x-wire-requestid': [ '3eb15841-5e18-475e-a3ec-31e2b22e0ba4' ],
'content-length': [ '75' ],
connection: [ 'keep-alive' ],
'x-fetch-attempts': [ '1' ]
},
statusCode: 400,
code: 'E400',
method: 'GET',
uri: 'http://240.10.0.1:36339/ws/16nowkfxgqqsb476bdqdl1io8pmpr7c0/uyuzgck3/npm/%40me%2Ffake-package-from-me',
body: {
success: false,
error: "Bad request. The package name '@me' is invalid."
},
pkgid: '@me/fake-package-from-me'
}
Unhandled Rejection! This is a bug and should be reported: https://github.com/raineorshine/npm-check-updates/issues
Expected Behavior
Not being able to find information about a specific package should not cause the rest of the checks to not run/fail. For example, npm outdated and npm-check(from the npm-check package gracefully handle this scenario and simply ignores packages it cannot find information for. Removing the "@me" from the fake package seems to make this error go away.
The text was updated successfully, but these errors were encountered:
npm-check-updates is designed to ignore a 404 error code, which is the standard error when a package is not found. It seems that your custom registry is returning a 400 Bad Request due to the org prefix.
I'm not able to reproduce this exactly, since I don't have a registry that returns 400, but I tried to extend the error catching logic anyway. Try v17.1.3 and let me know if that works.
Steps to Reproduce
This issue is difficult to reproduce since it's happening when using internal packages that are published to an internal npm repository. So I'm coming up with my own way to reproduce the error based on what I think is going wrong. Might not be the best way.
NCU fails to fetch the information for the package and throws an unhandled error. The current workaround for me is to just skip checking for that package but this should be handled in a cleaner way. Seems to have something to do with the name.
Steps:
"@me/fake-package-from-me": "1.0"
to your package.jsonncu
Current Behavior
Throws the following error and does no updates
Expected Behavior
Not being able to find information about a specific package should not cause the rest of the checks to not run/fail. For example,
npm outdated
andnpm-check
(from the npm-check package gracefully handle this scenario and simply ignores packages it cannot find information for. Removing the "@me" from the fake package seems to make this error go away.The text was updated successfully, but these errors were encountered: