GoogleChromeLabs / simplehttp2server

A simple HTTP/2 server for development
Other
1.74k stars 99 forks source link

Installation error #27

Closed marvinhagemeister closed 7 years ago

marvinhagemeister commented 7 years ago

OS: MacOS Sierra

When installing I always get an exception (found at https://github.com/developit/preact-cli/issues/26):

$ npm i simplehttp2server
> simplehttp2server@1.0.0 postinstall /Users/marvinhagemeister/dev/http2server/node_modules/simplehttp2server
> node lib/install.js

  ⚠ The `/Users/marvinhagemeister/dev/http2server/node_modules/simplehttp2server/vendor/simplehttp2server` binary doesn't seem to work correctly
  ⚠ simplehttp2server pre-build test failed
  ℹ compiling from source
  ✖ Error: mkdir -p /Users/marvinhagemeister/dev/http2server/node_modules/simplehttp2server/vendor && sh crosscompile.sh && mv ./0f3bf125-3c46-428e-94d8-d7546e50273f_darwin_amd64 /Users/marvinhagemeister/dev/http2server/node_modules/simplehttp2server/vendor/simplehttp2server
Command failed: sh crosscompile.sh && mv ./0f3bf125-3c46-428e-94d8-d7546e50273f_darwin_amd64 /Users/marvinhagemeister/dev/http2server/node_modules/simplehttp2server/vendor/simplehttp2server
simplehttp2server.go:24:2: cannot find package "github.com/NYTimes/gziphandler" in any of:
    /usr/local/Cellar/go/1.8.1/libexec/src/github.com/NYTimes/gziphandler (from $GOROOT)
    /Users/marvinhagemeister/go/src/github.com/NYTimes/gziphandler (from $GOPATH)
simplehttp2server.go:24:2: cannot find package "github.com/NYTimes/gziphandler" in any of:
    /usr/local/Cellar/go/1.8.1/libexec/src/github.com/NYTimes/gziphandler (from $GOROOT)
    /Users/marvinhagemeister/go/src/github.com/NYTimes/gziphandler (from $GOPATH)
simplehttp2server.go:24:2: cannot find package "github.com/NYTimes/gziphandler" in any of:
    /usr/local/Cellar/go/1.8.1/libexec/src/github.com/NYTimes/gziphandler (from $GOROOT)
    /Users/marvinhagemeister/go/src/github.com/NYTimes/gziphandler (from $GOPATH)
simplehttp2server.go:24:2: cannot find package "github.com/NYTimes/gziphandler" in any of:
    /usr/local/Cellar/go/1.8.1/libexec/src/github.com/NYTimes/gziphandler (from $GOROOT)
    /Users/marvinhagemeister/go/src/github.com/NYTimes/gziphandler (from $GOPATH)
simplehttp2server.go:24:2: cannot find package "github.com/NYTimes/gziphandler" in any of:
    /usr/local/Cellar/go/1.8.1/libexec/src/github.com/NYTimes/gziphandler (from $GOROOT)
    /Users/marvinhagemeister/go/src/github.com/NYTimes/gziphandler (from $GOPATH)

    at ChildProcess.exithandler (child_process.js:205:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
http2server@1.0.0 /Users/marvinhagemeister/dev/http2server
surma commented 7 years ago

Sadly, the simplehttp2server npm package is not by me.

Please re-open this issue on the respective repo.

kamalasaurus commented 7 years ago

@marvinhagemeister I've posted a workaround here: https://github.com/developit/preact-cli/issues/73

surma commented 7 years ago

Actually, I have an idea on how to fix this on my end as well.

surma commented 7 years ago

I believe I have fixed this on my end. npm i simplehttp2server should work again :)

marvinhagemeister commented 7 years ago

Thanks for having a look. Just tried again today, but I get the same error as in the original post.

surma commented 7 years ago

Can you double-check if the problem is exactly the same, because it shouldn’t be. (Also, run npm cache clean if you haven’t already).

marvinhagemeister commented 7 years ago

@surma sure, just double checked with both yarn, npm and node 7.10 + 8.0.0. The issue is unfortunately reproducible for all combinations.

Maybe there is something wrong with the binaries itself? The first message is about the binaries not working correctly and than it proceeds to build fresh from source. I'm not familiar at all with go or how they generate the binaries.

The `/myproject/node_modules/simplehttp2server/vendor/simplehttp2server` binary doesn't seem to work correctly

EDIT: whoops, just saw your comment about that here: https://github.com/developit/preact-cli/issues/26#issuecomment-306498318

marvinhagemeister commented 7 years ago

I'll close this one, since it's already tracked in https://github.com/1000ch/simplehttp2server/issues/2

surma commented 7 years ago

Yeah, I am aware. That message is a red herring. I can’t reproduce the failure at all.

FWIW, I am working on an upstream fix at 1000ch/simplehttp2server#3.