spencermountain / unrequired

find unused javascript files in your project
108 stars 8 forks source link

relative path issue for tmp file #7

Closed Smolations closed 5 years ago

Smolations commented 5 years ago

This doesn't work for me in my docker container. No JSX files, but I am using es6 syntax (if that makes a difference):

root@9edc82733ecc:/usr/src/app# unrequired ./src/js/spa.js  

Compiling the javascript..

npx: installed 4 in 1.423s
fs.js:115
    throw err;
    ^

Error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/unrequired/_tmp-build.js.map'
    at Object.openSync (fs.js:439:3)
    at Object.readFileSync (fs.js:344:35)
    at getUsed (/usr/local/lib/node_modules/unrequired/src/get-used.js:12:29)

I installed the lib globally as recommended in the README. I also tried installing to my local app for S's and G's, but get the same error. Node 10 in linux docker env, installed your package today.

spencermountain commented 5 years ago

hey Chris, thanks. I need to make some time to improve this tool. Will check back when it's fixed

Smolations commented 5 years ago

One more tidbit that might help, I found those temp build files in the directory from which I was running the command instead of somewhere in the node_modules/unrequired/ folder (e.g. ./_tmp-build.js.map.

spencermountain commented 5 years ago

ahhh that helps a lot. thanks!

spencermountain commented 5 years ago

should work now in 0.2.0 thanks for the help

firaskrichi commented 5 years ago

I'm running 0.2.0 still not working