raineorshine / npm-check-updates

Find newer versions of package dependencies than what your package.json allows
Other
9.19k stars 321 forks source link

Node v21: rimraf module not found #1367

Open its-dibo opened 5 months ago

its-dibo commented 5 months ago

when I run npx npm-check-updates on Node v21 I got Error: Cannot find module 'node_modules/npm-check-updates/node_modules/rimraf/dist/commonjs/index.js'

raineorshine commented 5 months ago

That looks like some kind of npm install error. I'm able to do npx npm-check-updates on Node v21 without an error:

raine[template]% node -v
v21.6.1
raine[template]% npx npm-check-updates
Need to install the following packages:
npm-check-updates@16.14.14
Ok to proceed? (y)
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
Checking /Users/raine/projects/ncu-issues/template/package.json
[====================] 2/2 100%

 ncu-test-tag   1.0.0  →   1.1.0
 ncu-test-v2   ^1.0.0  →  ^2.0.0

Run npx npm-check-updates -u to upgrade package.json

I would try clearing the npx cache and see if that helps.

its-dibo commented 4 months ago

related, but still not working https://github.com/raineorshine/npm-check-updates/pull/1372

raineorshine commented 4 months ago

It's not related to #1372, as that change has not been published.

its-dibo commented 4 months ago

waiting for the new version to see if it solves the issue

raineorshine commented 4 months ago

Does the same problem also occur when you do npm install -g npm-check-updates and run ncu?

ZaLiTHkA commented 1 month ago

if I'm not mistaken, if a particular package is not already installed, npx will install that package and it's dependencies list, but not it's devDependencies list...

I think this is happening because npm-check-updates has everything listed under devDependencies, so perhaps the fix here is to shift the "runtime packages" to to the dependencies list?

That looks like some kind of npm install error. I'm able to do npx npm-check-updates on Node v21 without an error...

to be fair, you (@raineorshine) would most likely already have rimraf available in your environment, this particular scenario would only occur in relatively clean environments.

raineorshine commented 1 month ago

@ZaLiTHkA You're looking at the main branch, which has not yet been published. The v16 branch does include rimraf in its dependencies.

The new vite build bundles all dependencies in the published package, so the normal dependencies/devDependencies distinction does not apply.