Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install on Win 7 64 bits (can't download jpegtran.exe) #54

Closed
pjfsilva opened this issue Dec 10, 2014 · 39 comments
Closed

Can't install on Win 7 64 bits (can't download jpegtran.exe) #54

pjfsilva opened this issue Dec 10, 2014 · 39 comments

Comments

@pjfsilva
Copy link

I'm trying to install jpegtran-bin by doing:
npm cache clean -f
npm install jpegtran-bin

The error I get is:

npm info postinstall jpegtran-bin@2.0.2

> jpegtran-bin@2.0.2 postinstall C:\a\node_modules\jpegtran-bin
> node lib/install.js

  ‼ ENOENT, stat 'C:\a\node_modules\jpegtran-bin\vendor\jpegtran.exe'
  ‼ jpegtran pre-build test failed
  i compiling from source
  × Error: Command failed: '.' is not recognized as an internal or external comm
and,
operable program or batch file.

    at ChildProcess.exithandler (child_process.js:648:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

Checking my vendor folder it seems the file win/x64/jpegtran.exe isn't downloaded, I only have "libjpeg-62.dll" but I can't see any error even using -ddd switch. I've disabled antivirus and stuff like that and I tried over 2 networks with no luck...

Is there anything I can do to get more log or understand this better?

@pjfsilva
Copy link
Author

Trying jpegtran-bin@2.0.1 and jpegtran-bin@2.0.0 also have the same problem. 1.0.2 and 1.0.1 don't seem to work also.

1.0.0 works correctly downloading the binary file and copying it to vendor folder.
Doing a very old jpegtran-bin@0.2.0 seems to work OK and downloads the binary without problem.

So I'm guessing it has something to do with this: 1a6d1a2

Maybe something to do with windows permissions on how to download/copy .exe to the right folder or something like that?

@pjfsilva
Copy link
Author

OK, I can confirm the problem has something to do with bin-build / bin-wrapper.
If I manually downgrade to

"bin-build": "^0.2.0",
"bin-wrapper": "^0.4.0",

For example by using this npm-shrinkwrap.json: https://gist.github.com/pjfsilva/19e305be92270f38bc6e

Everything works correctly with jpegtran-bin@2.0.2 so it seems the problem is on that libraries.

@royaldark
Copy link

👍 also unable to install on Win7 x64 with same error

@brrih
Copy link

brrih commented Dec 10, 2014

Same issue, but Win8.1 x64. :( Frustrating.

@jaylinski
Copy link

same here, win7 x64

> jpegtran-bin@2.0.2 postinstall C:\xampp\htdocs\_www\frontend-workflow\node_modules\gulp-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin
> node lib/install.js

  ‼ ENOENT, stat 'C:\xampp\htdocs\_www\frontend-workflow\node_modules\gulp-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin\vendor\jpegtran.exe'
  ‼ jpegtran pre-build test failed
  i compiling from source
  × Error: Command failed: Der Befehl "." ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

    at ChildProcess.exithandler (child_process.js:648:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

@brrih
Copy link

brrih commented Dec 12, 2014

Hey @kevva,

The installs for Windows are screwing it up because it needs two files --- all other OS's had just one file, hence no array. So in the download module, done() was being called after the first iteration (so whatever element is last in the array was the file actually downloaded). Line 148 in index.js

@brrih
Copy link

brrih commented Dec 12, 2014

I couldn't find an elegant solution to this sadly, but it's definitely the problem. Good luck!

@steveoh
Copy link

steveoh commented Dec 16, 2014

yikes. 👍

@jorgeacurcio
Copy link

👍

2 similar comments
@romuloctba
Copy link

+1

@siiron
Copy link

siiron commented Dec 16, 2014

+1

@ClemensSchneider
Copy link

+1 (Windows 8.1 64bit)

@bmds
Copy link

bmds commented Dec 17, 2014

We've now had to remove gulp-imagemin from our process due to this, a pretty painful issue

@joseluisq
Copy link

The same error on Windows 7 x64 :/

‼ jpegtran pre-build test failed
i compiling from source
× Error: Command failed: '.' is not recognized as an internal or external comm

@blackfyre
Copy link

👍

@richardchen85
Copy link

disclaimer-logo

@maranomynet
Copy link

@kevva, Is there a fix on the way?

@dingdreher
Copy link

download the last release as zip and copy the files to:

<yourworkfolder>\node_modules\gulp-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin\vendor\

@sjmcpherson
Copy link

@dingdreher that worked for me, yay!

@jerome-nelson
Copy link

Just to expand on what @dingdreher has posted. The main problem seems to be that the jpegtran.exe is not copied into the jpegtran-bin/vendor folder (just the libjpeg-62.dll file).

What I did to get grunt-imagemin to work was save the vendor/jpegtran.exe in this repo to my jpegtran/vendor/ folder (this is considering that you are using the latest version of jpegtran-bin).

example:
example-1

Where I installed the jpegtran.exe

example-2

How I found out where I needed to install (this output occurs when attempting to install jpegtran-bin.

@maranomynet
Copy link

A proper fix would be preferable, of course.
These manual workarounds aren't easily automated.

@kyleva
Copy link

kyleva commented Dec 22, 2014

None of the listed solutions are working in my instance on Win 8.1 (x64).

I've tried the solution provided by @pjfsilva by downgrading the following jpegtran-bin/package.json:

"bin-build": "^0.2.0",
"bin-wrapper": "^0.4.0"

Also, downloading the latest files and copying to the vendor directory as suggested by @dingdreher I'm still receiving an error when building.

Image of issue when building

@tedyoung
Copy link

This worked for me: grabbed the 2.0.2 ZIP file from https://github.com/imagemin/jpegtran-bin/releases, then (using WinRAR or similar) navigated to jpegtran-bin-2.0.2.zip\jpegtran-bin-2.0.2\vendor\win\x64, where there are two files (jpegtran.exe and libjpeg-62.dll), and extracted just those two files to my node modules directory that's under my current project: node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin\vendor\ (previously only the dll was there, not the exe) and everything now works.

@rjp2525
Copy link

rjp2525 commented Dec 23, 2014

@tedyoung Your solution works for me as well.

@AlkarE
Copy link

AlkarE commented Dec 23, 2014

tedyoung +1
windows 7 x64

@avif
Copy link

avif commented Dec 24, 2014

tedyoung +1

@artdevjs
Copy link

@tedyoung Help for me on Win 8.1 x64

@IOZ
Copy link

IOZ commented Dec 25, 2014

@tedyoung this crutch work as well.
Cheers.

@avif
Copy link

avif commented Dec 25, 2014

@artemmedvedev have you tried tedyoung's solution? did you get the same error?

@artdevjs
Copy link

@avif yes, I had the same problem, but when I copy and replace two files problem was fixed

@shinnn
Copy link
Contributor

shinnn commented Dec 27, 2014

Hi, everyone.

I confirmed the issue and created PRs to fix it. kevva/download#43 kevva/bin-wrapper#33
If they are merged, jpegtran-bin will work fine on Windows.

@kevva @sindresorhus Please review them.

@brrih
Copy link

brrih commented Dec 27, 2014

I'm guessing that no word from the authors for nearly three weeks means they're too busy to fix it, so what's next? This is a part of Web Starter Kit, so it has some major implications.

@vweevers
Copy link

@pjfsilva it might help if you change the title to something like "Doesn't download jpegtran on all versions of Windows" so that this issue won't be viewed (and then dismissed) as an edge-case.

@shinnn
Copy link
Contributor

shinnn commented Dec 28, 2014

@kevva @sindresorhus Could you give me write access for jpegtran-bin and imagemin-jpegtran npm package?

@sindresorhus
Copy link
Contributor

@shinn done

@shinnn
Copy link
Contributor

shinnn commented Dec 28, 2014

@sindresorhus thanks

@shinnn
Copy link
Contributor

shinnn commented Dec 28, 2014

bin-wrapper has been updated so jpegtran-bin now works fine on Windows, I think.

Could anyone reinstall jpegtran-bin, test it and tell us whether it works or not? (I'm not a Windows user)

@vweevers
Copy link

@shinnn confirmed on windows 7. Both files are downloaded. Thanks!

@shinnn
Copy link
Contributor

shinnn commented Dec 28, 2014

OK, closing this issue since imagemin-jpegtran passed the test on AppVeyor and the actual Windows user @vweevers confirmed that it works.

@pjfsilva @jaylinski @brih @dingdreher @jerome-nelson @kyleva @tedyoung
I couldn't find the cause without your detailed reports. Thanks.

By the way, I'd be glad if someone of Windows users could build v1.3.1 Windows binary and contribute to #55 :) Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests