eggheadio / gatsby-starter-egghead-blog

This is an example Gatsby blog site that we use as a reference at egghead.
https://egghead-gatsby-starter.netlify.com/
MIT License
517 stars 82 forks source link

Error building on Windows #12

Closed JFrankfurt closed 5 years ago

JFrankfurt commented 5 years ago

Tried building a release of pngquant and ran into some issues there as well. (Though, that was with a rust language feature I didn't understand.)

This has something to do with the sharp package.

λ npm ls sharp
gatsby-mdx-blog-starter-project@1.0.0 C:\Users\user\devwork\website
+-- gatsby-plugin-manifest@2.0.2
| `-- sharp@0.20.8
+-- UNMET DEPENDENCY gatsby-plugin-sharp@2.0.5
| `-- sharp@0.20.8  deduped
`-- gatsby-transformer-sharp@2.1.1
  `-- sharp@0.20.8  deduped
1927 verbose stack Error: pngquant-bin@5.0.0 postinstall: `node lib/install.js`
1927 verbose stack Exit status 1
1927 verbose stack     at EventEmitter.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
1927 verbose stack     at EventEmitter.emit (events.js:197:13)
1927 verbose stack     at ChildProcess.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
1927 verbose stack     at ChildProcess.emit (events.js:197:13)
1927 verbose stack     at maybeClose (internal/child_process.js:984:16)
1927 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
1928 verbose pkgid pngquant-bin@5.0.0
1929 verbose cwd C:\Users\user\devwork\website
1930 verbose Windows_NT 10.0.17134
1931 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i"
1932 verbose node v11.10.0
1933 verbose npm  v6.4.1
1934 error code ELIFECYCLE
1935 error errno 1
1936 error pngquant-bin@5.0.0 postinstall: `node lib/install.js`
1936 error Exit status 1
wesleygrimes commented 5 years ago

Hi @JFrankfurt,

I am on Windows 10, running Node 10.15.1 and if I run the following:

$ git clone git@github.com:eggheadio/gatsby-starter-egghead-blog.git
cd .\gatsby-starter-egghead-blog\
npm install

My output is as follows:

> sharp@0.21.1 install C:\users\wgrimes\github\gatsby-starter-egghead-blog\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached C:\ProgramData\scoop\persist\nodejs-lts\cache\_libvips\libvips-8.7.0-win32-x64.tar.gz
info sharp Creating C:\users\wgrimes\github\gatsby-starter-egghead-blog\node_modules\sharp\build\Release
info sharp Copying DLLs from C:\users\wgrimes\github\gatsby-starter-egghead-blog\node_modules\sharp\vendor\lib to C:\users\wgrimes\github\gatsby-starter-egghead-blog\node_modules\sharp\build\Release

> cwebp-bin@5.0.0 postinstall C:\users\wgrimes\github\gatsby-starter-egghead-blog\node_modules\cwebp-bin
> node lib/install.js

  √ cwebp pre-build test passed successfully

> mozjpeg@6.0.1 postinstall C:\users\wgrimes\github\gatsby-starter-egghead-blog\node_modules\mozjpeg> node lib/install.js

  √ mozjpeg pre-build test passed successfully

> pngquant-bin@5.0.1 postinstall C:\users\wgrimes\github\gatsby-starter-egghead-blog\node_modules\pngquant-bin
> node lib/install.js

  √ pngquant pre-build test passed successfully
npm WARN rollback Rolling back node-pre-gyp@0.10.0 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\users\wgrimes\github\gatsby-starter-egghead-blog\node_modules\fsevents\node_modules'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 2110 packages from 1223 contributors and audited 26802 packages in 34.376s
found 2 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

Then if I run:

$ gatsby develop

I am able to load the website at http://localhost:8000

I am wondering if it's an issue with Node v11.

Or are you doing something completely different that maybe I am missing?

Have a great day! Wes

theianjones commented 5 years ago

@JFrankfurt could you give this a shot? I will look into this more.

https://github.com/imagemin/pngquant-bin/issues/78#issuecomment-373845611

JFrankfurt commented 5 years ago

@ijones16 Had notifs off, sorry about that. I'll be on that machine again later tonight and will check across versions.

joelhooks commented 5 years ago

Closed as inactive, happy to open up again if required.