ModClean / modclean

Remove unwanted files and directories from your node_modules folder
MIT License
400 stars 15 forks source link

Undefined reference - pkg in modclean.js on v3.0.0-alpha.5 #24

Closed chrismoorhouse closed 6 years ago

chrismoorhouse commented 6 years ago

v3.0.0-alpha.5 fails to run in my docker container with the following error.

Step 25/32 : RUN npm install modclean -g && modclean -r [main] ---> Running in f335624c34e4 [main] /usr/local/bin/modclean -> /usr/local/lib/node_modules/modclean/bin/modclean.js [main] + modclean@3.0.0-alpha.5 [main] added 41 packages in 0.701s [main] /usr/local/lib/node_modules/modclean/bin/modclean.js:56 [main] chalk.gray(' Version ' + pkg.version) + "\n" [main] ^ [main] ReferenceError: pkg is not defined [main] at new ModClean_CLI (/usr/local/lib/node_modules/modclean/bin/modclean.js:56:38) [main] at Object. (/usr/local/lib/node_modules/modclean/bin/modclean.js:280:1) [main] at Module._compile (module.js:652:30) [main] at Object.Module._extensions..js (module.js:663:10) [main] at Module.load (module.js:565:32) [main] at tryModuleLoad (module.js:505:12) [main] at Function.Module._load (module.js:497:3) [main] at Function.Module.runMain (module.js:693:10) [main] at startup (bootstrap_node.js:188:16) [main] at bootstrap_node.js:609:3

My node version is 8.11.1

KyleRoss commented 6 years ago

@yutter Thanks for reporting, I have yet to test the CLI portion, only focusing on the programmatic for the time being as it is what the CLI uses underlying. I should have this fixed in the next day or so.

KyleRoss commented 6 years ago

@yutter This issue has been fixed and published in version 3.0.0-alpha.6. I will be testing these more over the next week and hopefully be ready for a beta.

Thanks for testing this and reporting, it is helpful.