ModClean / modclean

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

Cli use throws promisify error #29

Closed RuntimeRascal closed 4 years ago

RuntimeRascal commented 6 years ago

Hello

I have been unable to get the CLI to work
I recieve the following error details when run the modclean command:

const glob = util.promisify(require('glob'));
                  ^

TypeError: util.promisify is not a function
    at Object.<anonymous> (C:\Users\Tommy\AppData\Roaming\nvm\v7.7.4\node_modules\modclean\lib\modclean.js:15:19)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\Tommy\AppData\Roaming\nvm\v7.7.4\node_modules\modclean\bin\modclean.js:11:18)
    at Module._compile (module.js:571:32)

I currently use Node v7.7.4

Steps to reproduce

run npm i -g modclean run modclean

Destreyf commented 6 years ago

@simpert It appears that modclean took advantage of the util.promisify function at some point.

This function is only available in node 8.0.0 and higher (https://nodejs.org/dist/latest-v8.x/docs/api/util.html#util_util_promisify_original)

Looking at the Master branch, it's clearly not used, however i noticed on the NPM page, that its referencing modclean v3, which appears to be a separate branch (https://github.com/ModClean/modclean/tree/3.0.0-dev)

If you want to function with node 7, i suggest trying npm i -g modclean@2.1.2 in order to install v2 based modclean (which supports node 6.9+)