gomplate / gomplate-npm

Install gomplate using npm!
https://gomplate.ca
MIT License
7 stars 1 forks source link

"npm i gomplate" fails on Windows #4

Closed hairyhenderson closed 5 years ago

hairyhenderson commented 5 years ago

From @MikhailSemichev in hairyhenderson/gomplate#522, :


Hello, I'm trying to run "npm i gomplate" on Windows 10. And there is a wrong path 404 error

npm install gomplate

> gomplate@3.3.1 postinstall D:\foo\node_modules\gomplate
> go-npm install

Downloading from URL: https://github.com/hairyhenderson/gomplate/releases/download/v3.3.1/gomplate_windows-amd64-slim
Error downloading binary. HTTP Status Code: 404

The problem is in absence of ".exe" in download path The correct download path should be:

https://github.com/hairyhenderson/gomplate/releases/download/v3.3.1/gomplate_windows-amd64-slim.exe
hairyhenderson commented 5 years ago

@RecuencoJones I think this is an issue with go-npm - it looks like we need a {{ extension }} variable that's set to .exe for Windows?

RecuencoJones commented 5 years ago

Created https://github.com/RecuencoJones/go-npm/pull/1 for fixing this.

Essentially, if {{win_ext}} is specified in the URL and current platform is windows, it will set .exe extension in the URL.

Unfortunately I'm unable to test it right now, I have a larger suite of tests ready for push @home, will let you know once this is ready for integrating with gomplate-npm.

There's a slight problem tho, we cannot override already published version 3.3.1 😥

hairyhenderson commented 5 years ago

There's a slight problem tho, we cannot override already published version 3.3.1 😥

d'oh! That's OK though - I think a v3.4.0 may be coming soon 😉 - I can wait on this fix for that.

RecuencoJones commented 5 years ago

Just tested on a Win 10 laptop with latest changes from #5

PS C:\Users\david\Workspace\GitHub\gomplate\gomplate-npm> npm i

> gomplate@3.3.1 postinstall C:\Users\david\Workspace\GitHub\gomplate\gomplate-npm
> go-npm install

Downloading from URL: https://github.com/hairyhenderson/gomplate/releases/download/v3.3.1/gomplate_windows-amd64.exe
Placed binary on C:\Users\david\Workspace\GitHub\gomplate\gomplate-npm\node_modules\.bin\gomplate.exe
up to date in 73.425s

Seems to be working as expected!

hairyhenderson commented 5 years ago

The fix is in (thank you @RecuencoJones!!), however it won't be active until the next release of gomplate (probably v3.4.0 some time in the next ~week)

MikhailSemichev commented 5 years ago

Hello Guys! When do you plan release a new version of the package to NPM? Since for now "npm install gomplate -g" is still crushing in Windows.

hairyhenderson commented 5 years ago

Sorry @MikhailSemichev - I thought I published this when I did the 3.4.0 release - will get that published now 🤦‍♂️

hairyhenderson commented 5 years ago

@MikhailSemichev Published! 😅

MikhailSemichev commented 5 years ago

@MikhailSemichev Published! 😅

It works! Lots of thanks @hairyhenderson !