voidcosmos / npkill

List any node_modules 📦 dir in your system and how heavy they are. You can then select which ones you want to erase to free up space 🧹
https://npkill.js.org
MIT License
8.33k stars 188 forks source link

Node.js v18.16.0,There is a type error at line 262 of the controller file controller.js, the line of code tries to access error.message, but the error variable is undefined, causing the program to crash #162

Closed youkei-zzz closed 1 year ago

youkei-zzz commented 1 year ago

D:/pnpm/.pnpm-store/v3/tmp/dlx-32444/node_modules/.pnpm/npkill@0.11.2/node_modules/npkill/lib/controller.js:262 this.newError(error.message); ^

TypeError: Cannot read properties of undefined (reading 'message') at process. (file:///D:/pnpm/.pnpm-store/v3/tmp/dlx-32444/node_modules/.pnpm/npkill@0.11.2/node_modules/npkill/lib/controller.js:262:33) at process.emit (node:events:513:28) at process._fatalException (node:internal/process/execution:149:25)

Node.js v18.16.0  ERROR  Command failed with exit code 7: npkill

pnpm: Command failed with exit code 7: npkill at makeError (D:\NodeJS\node_global\node_modules\pnpm\dist\pnpm.cjs:24230:17) at handlePromise (D:\NodeJS\node_global\node_modules\pnpm\dist\pnpm.cjs:24801:33) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.handler [as dlx] (D:\NodeJS\node_global\node_modules\pnpm\dist\pnpm.cjs:206754:7) at async D:\NodeJS\node_global\node_modules\pnpm\dist\pnpm.cjs:216086:21 at async main (D:\NodeJS\node_global\node_modules\pnpm\dist\pnpm.cjs:216053:34) at async runPnpm (D:\NodeJS\node_global\node_modules\pnpm\dist\pnpm.cjs:216308:5) at async D:\NodeJS\node_global\node_modules\pnpm\dist\pnpm.cjs:216300:7

crystalball808 commented 1 year ago

Have the same problem. Node 18.16.0 npm 9.5.1

zaldih commented 1 year ago

Thanks for the reports. I think is related with #159 . Working on that.

zaldih commented 1 year ago

It should be fixed when the next version is released!