I'm having trouble installing preact-cli this morning. Tested on MacOS and inside a fresh linux vm and docker image:
$ npm install -g preact-cli
/usr/local/bin/preact -> /usr/local/lib/node_modules/preact-cli/lib/index.js
> [email protected] install /usr/local/lib/node_modules/preact-cli/node_modules/fsevents
> node install
[fsevents] Success: "/usr/local/lib/node_modules/preact-cli/node_modules/fsevents/lib/binding/Release/node-v51-darwin-x64/fse.node" is installed via remote
> [email protected] postinstall /usr/local/lib/node_modules/preact-cli/node_modules/simplehttp2server
> node lib/install.js
âš The `/usr/local/lib/node_modules/preact-cli/node_modules/simplehttp2server/vendor/simplehttp2server` binary doesn't seem to work correctly
âš simplehttp2server pre-build test failed
ℹ compiling from source
✖ Error: mkdir -p /usr/local/lib/node_modules/preact-cli/node_modules/simplehttp2server/vendor && sh crosscompile.sh && mv ./57924994-9b31-49b1-afa2-51924472b375_darwin_amd64 /usr/local/lib/node_modules/preact-cli/node_modules/simplehttp2server/vendor/simplehttp2server
Command failed: sh crosscompile.sh && mv ./57924994-9b31-49b1-afa2-51924472b375_darwin_amd64 /usr/local/lib/node_modules/preact-cli/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)
/usr/local/lib
# ... (long npm output here)
npm WARN [email protected] requires a peer of preact@* but none was installed.
The last error, that preact is not installed properly should be an easy fix. The issue with simplehttp2server seems a bit more involved.
Both are warnings and the install should actually work. I'm not sure what we can do about the Go thing, that's just the output of the node wrapper we use to install simplehttp2server - it tries a bunch of methods and uses whatever works.
The preact peer dep issue we can fix though.
Seems like this is a duplicate of https://github.com/developit/preact-cli/issues/24
Yup! I was thinking of closing it once the peer dependency issue is fixed.
I got this issue on Windows 10 too.
It works after I upgraded to Go v1.8.3 from v1.8.0 😇
@redstrike Hum.. I didn't install Go development environment on my machine, shouldn't it have a prebuilt binary?
@thangngoc89 I'm using a Windows machine, so I just downloaded go1.8.3.windows-amd64.msi at Downloads page, then run it > Next > Next ... 😃 So easy, isn't it?
@redstrike I mean it shouldn't be a requirement. Most node.js library have prebuilt version of the binary included. Maybe this is something to report back to the project's owner?
@thangngoc89 It's still unresolved on their end. See https://github.com/GoogleChrome/simplehttp2server/issues/27
@marvinhagemeister Just to be clear: I am not the owner of the npm package. I just merged a temporary band-aid fix for this problem on my end. Apparently, it doesn’t fix 100% of errors.
I am working with the owner to resolve this here: 1000ch/simplehttp2server#3
@marvinhagemeister closing this because apparently it works based on this.
Feel free to reopen if it doesn't tough. 😄
Most helpful comment
@marvinhagemeister closing this because apparently it works based on this.
Feel free to reopen if it doesn't tough. 😄