When I try to create a new app using Gatsby I am getting the below error.
I have installed VS 2015 C++ build tools from here,
https://www.microsoft.com/en-us/download/details.aspx?id=48159
C:\_Projects\Gatsby>gatsby new gatsby-site
info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-default.git
Cloning into 'gatsby-site'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 1069 (delta 1), reused 5 (delta 1), pack-reused 1061
Receiving objects: 100% (1069/1069), 1.77 MiB | 435.00 KiB/s, done.
Resolving deltas: 100% (606/606), done.
success Created starter directory layout
info Installing packages...
> [email protected] install C:\_Projects\Gatsby\gatsby-site\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-win32-x64.tar.gz
info sharp Creating C:\_Projects\Gatsby\gatsby-site\node_modules\sharp\build\Release
info sharp Copying DLLs from C:\_Projects\Gatsby\gatsby-site\node_modules\sharp\vendor\lib to C:\_Projects\Gatsby\gatsby-site\node_modules\sharp\build\Release
> [email protected] postinstall C:\_Projects\Gatsby\gatsby-site\node_modules\cwebp-bin
> node lib/install.js
√ cwebp pre-build test passed successfully
> [email protected] postinstall C:\_Projects\Gatsby\gatsby-site\node_modules\mozjpeg
> node lib/install.js
√ mozjpeg pre-build test passed successfully
> [email protected] postinstall C:\_Projects\Gatsby\gatsby-site\node_modules\pngquant-bin
> node lib/install.js
‼ Command failed: C:\_Projects\Gatsby\gatsby-site\node_modules\pngquant-bin\vendor\pngquant.exe --version
‼ pngquant pre-build test failed
i compiling from source
× Error: pngquant failed to build, make sure that libpng-dev is installed
at Promise.all.then.arr (C:\_Projects\Gatsby\gatsby-site\node_modules\bin-build\node_modules\execa\index.js:231:11)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\vignesh_s1\AppData\Roaming\npm-cache\_logs\2019-01-03T10_35_46_480Z-debug.log
error Command failed: npm install
Error: Command failed: npm install
- index.js:236 Promise.all.then.arr
[x64]/[gatsby-cli]/[execa]/index.js:236:11
- util.js:16 tryCatcher
[x64]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23
- promise.js:512 Promise._settlePromiseFromHandler
[x64]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31
- promise.js:569 Promise._settlePromise
[x64]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18
- promise.js:614 Promise._settlePromise0
[x64]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10
- promise.js:694 Promise._settlePromises
[x64]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18
- promise.js:638 Promise._fulfill
[x64]/[gatsby-cli]/[bluebird]/js/release/promise.js:638:18
- promise_array.js:126 PromiseArray._resolve
[x64]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:126:19
- promise_array.js:144 PromiseArray._promiseFulfilled
[x64]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:144:14
- promise.js:574 Promise._settlePromise
[x64]/[gatsby-cli]/[bluebird]/js/release/promise.js:574:26
- promise.js:614 Promise._settlePromise0
[x64]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10
- promise.js:694 Promise._settlePromises
[x64]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18
- async.js:138 _drainQueueStep
[x64]/[gatsby-cli]/[bluebird]/js/release/async.js:138:12
- async.js:131 _drainQueue
[x64]/[gatsby-cli]/[bluebird]/js/release/async.js:131:9
- async.js:147 Async._drainQueues
[x64]/[gatsby-cli]/[bluebird]/js/release/async.js:147:5
- async.js:17 Immediate.Async.drainQueues
[x64]/[gatsby-cli]/[bluebird]/js/release/async.js:17:14
C:\_Projects\Gatsby>
@vickylance sorry you are experiencing this issue with gatsby. What i would like is for you to go to here and follow through the document and see if help you solve your issue, And provide some feedback afterwards. Sounds good?
@jonniebigodes Hi thanks for letting me know of the page but I already downloaded and installed the build tools from https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15 through my admin and now its working fine.
@vickylance glad you resolved your issue. Thanks for using Gatsby 👍
$ gatsby new kill8
info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-default.git
Cloning into 'kill8'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 1077 (delta 0), reused 2 (delta 0), pack-reused 1072
Receiving objects: 100% (1077/1077), 1.93 MiB | 15.12 MiB/s, done.
Resolving deltas: 100% (610/610), done.
success Created starter directory layout
info Installing packages...
> [email protected] install C:\project\gatsby\kill8\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-win32-x64.tar.gz
C:\project\gatsby\kill8\node_modules\sharp\install\libvips.js:77
throw err;
^
Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (_tls_wrap.js:1112:34)
at TLSSocket.emit (events.js:182:13)
at TLSSocket._finishInit (_tls_wrap.js:625:8)
User@ C:\project\gatsby\kill8\node_modules\sharp
$ if not defined npm_config_node_gyp (node "C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: self signed certificate in certificate chain
gyp ERR! stack at TLSSocket.onConnectSecure (_tls_wrap.js:1112:34)
gyp ERR! stack at TLSSocket.emit (events.js:182:13)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:625:8)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\project\gatsby\kill8\node_modules\sharp
gyp ERR! node -v v11.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2019-01-16T11_57_46_618Z-debug.log
error Command failed: npm install
Error: Command failed: npm install
- index.js:236 Promise.all.then.arr
[npm]/[gatsby-cli]/[execa]/index.js:236:11
- util.js:16 tryCatcher
[npm]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23
- promise.js:512 Promise._settlePromiseFromHandler
[npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31
- promise.js:569 Promise._settlePromise
[npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18
- promise.js:614 Promise._settlePromise0
[npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10
- promise.js:694 Promise._settlePromises
[npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18
- promise.js:638 Promise._fulfill
[npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:638:18
- promise_array.js:126 PromiseArray._resolve
[npm]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:126:19
- promise_array.js:144 PromiseArray._promiseFulfilled
[npm]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:144:14
- promise.js:574 Promise._settlePromise
[npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:574:26
- promise.js:614 Promise._settlePromise0
[npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10
- promise.js:694 Promise._settlePromises
[npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18
- async.js:138 _drainQueueStep
[npm]/[gatsby-cli]/[bluebird]/js/release/async.js:138:12
- async.js:131 _drainQueue
[npm]/[gatsby-cli]/[bluebird]/js/release/async.js:131:9
- async.js:147 Async._drainQueues
[npm]/[gatsby-cli]/[bluebird]/js/release/async.js:147:5
- async.js:17 Immediate.Async.drainQueues [as _onImmediate]
[npm]/[gatsby-cli]/[bluebird]/js/release/async.js:17:14
@jonniebigodes, the same problem, but the solution did not help :-(
@AlexLich Are u using windows or linux?
@vickylance win 10
Not really the same
gyp ERR! stack Error: self signed certificate in certificate chain
@DanielRuf I will try again setting NODE_TLS_REJECT_UNAUTHORIZED = 0, if the failure then I do not know what to do
NODE_TLS_REJECT_UNAUTHORIZED is not ideal.
Setting the verbosity level should shed some light on it.
NODE_TLS_REJECT_UNAUTHORIZEDis not ideal.Setting the verbosity level should shed some light on it.
He at least something helped, corporate computer. After setting NODE_TLS_REJECT_UNAUTHORIZED = 0, another mistake, I want to save, I only need to gettsby download and start developing:
$ gatsby new nihua
info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-default.git
Cloning into 'nihua'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 1077 (delta 0), reused 2 (delta 0), pack-reused 1072
Receiving objects: 100% (1077/1077), 1.93 MiB | 19.04 MiB/s, done.
Resolving deltas: 100% (610/610), done.
success Created starter directory layout
info Installing packages...
yarn install v1.5.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0/1545(node:8912) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
error An unexpected error occurred: "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz: SSL Error: SELF_SIGNED_CERT_IN_CHAIN".
info If you think this is a bug, please open a bug report with the information provided in "C:\\project\\gatsby\
ihua\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed: yarnpkg
Please try opening https://registry.yarnpkg.com/@babel/code-frame/ and https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz in your browser.
Either your OS CA bundle is outdated or there us some caching issue.
Please also try upgrading Yarn. 1.5.1 is a bit outdated. This might be also the case.
@DanielRuf https://registry.yarnpkg.com/@babel/code-frame/ and https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz in my browser openend.
Yarn updated.
There are no errors, but it is so obvious that the npm has not installed a new gatsby project. The terminal looks like the previous one, only terminates without errors on
[2/4] Fetching packages ...
[------] 0/1545
Please enable debug / verbose mode and set it to the highest possible version. Also check if this is caused by your security solutions (antivirus, firewall and so on).
Please enable debug / verbose mode and set it to the highest possible version. Also check if this is caused by your security solutions (antivirus, firewall and so on).
Perhaps the antivirus spoils, I really hate unmanaged antiviruses (such as Kaspersky), thanks for the help. There's nothing you can do. I started debug, I returned to the first error that I already encountered (remove package-lock.json.) , oh my goodness ...
Most helpful comment
@jonniebigodes Hi thanks for letting me know of the page but I already downloaded and installed the build tools from https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15 through my admin and now its working fine.