Gatsby: Gatsby new proj => ERR! sharp self signed certificate in certificate chain

Created on 27 Feb 2020  路  10Comments  路  Source: gatsbyjs/gatsby

Description

Getting Errors when trying to create a new project with Gatsby

Steps to reproduce

This is problematic as I work inside an organization firewall which might be causing the issues...

Expected result

A new Gatsby project is created

Actual result

...
info Installing packages...

[email protected] install H:\Projects\webapp\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.8.1/libvips-8.8.1-win32-x64.tar.gz
ERR! sharp self signed certificate in certificate chain
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies

H:\Projects\webapp\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\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:1321:34)
gyp ERR! stack at TLSSocket.emit (events.js:223:5)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:794:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd H:\Projects\webapp\node_modules\sharp
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
...

Error: Command failed with exit code 1: npm install

  • error.js:56 makeError
    [npm]/[gatsby-cli]/[execa]/lib/error.js:56:11

  • index.js:114 handlePromise
    [npm]/[gatsby-cli]/[execa]/index.js:114:26

  • task_queues.js:94 processTicksAndRejections
    internal/process/task_queues.js:94:5

Environment

System:
OS: Windows 10 10.0.17763
CPU: (4) x64 Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
Binaries:
Node: 12.14.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.21.1 - C:\Program Files (x86)Yarn\bin\yarn.CMD
npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 3.8.2

stale? bug

All 10 comments

Same issue

@vinceumo Can you add bit more context? Are you also in similar scenario as @ilanah ?

inside an organization firewall

The sharp version was out for some time, so it's not likely something new happened there.

There is general issue about self signed certificate in certificate chain error happening in node-gyp and corporate proxy is at least mentioned once there, so this might be related https://github.com/nodejs/node-gyp/issues/695

They present couple of options there, so please follow the discussion and make sure you also read up on NODE_TLS_REJECT_UNAUTHORIZED=0 if you try to use (it is bypassing security stuff, which is the reason the corporate proxy was done in first place)

Actually my error seems a bit different, I followed these steps:

gatsby new gatsby-site

Then I got the following errors:

error /Users/211103/Documents/projects/www/gatsby-site/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments: 
Directory: /Users/211103/Documents/projects/www/gatsby-site/node_modules/sharp
Output:
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-darwin-x64.tar.gz
fs.js:114
    throw err;
    ^

Error: EACCES: permission denied, copyfile '/var/folders/53/5lf8gtcj0yjfr570zz1yf6mmmcpds1/T/37285-libvips-8.8.1-darwin-x64.tar.gz' -> '/Users/211103/.npm/_libvips/libvips-8.8.1-darwin-x64.tar.gz'
    at Object.copyFileSync (fs.js:1728:3)
    at WriteStream.<anonymous> (/Users/211103/Documents/projects/www/gatsby-site/node_modules/sharp/install/libvips.js:104:16)
    at WriteStream.emit (events.js:198:13)
    at lazyFs.close (internal/fs/streams.js:207:14)
    at FSReqWrap.args [as oncomplete] (fs.js:140:20)
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/211103/.nvm/versions/node/v10.18.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/211103/Documents/projects/www/gatsby-site/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/211103/.nvm/versions/node/v10.18.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/211103/Library/Caches/node-gyp/10.18.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/211103/Library/Caches/node-gyp/10.18.1',
gyp info spawn args   '-Dnode_gyp_dir=/Users/211103/.nvm/versions/node/v10.18.1/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/211103/Library/Caches/node-gyp/10.18.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/211103/Documents/projects/www/gatsby-site/node_modules/sharp',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:25:
/usr/local/include/vips/vips8:35:10: fatal error: 'glib-object.h' file not found
#include <glib-object.h>
         ^~~~~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/sharp/src/common.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/211103/.nvm/versions/node/v10.18.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/Users/211103/.nvm/versions/node/v10.18.1/bin/node" "/Users/211103/.nvm/versions/node/v10.18.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/211103/Documents/projects/www/gatsby-site/node_modules/sharp





 ERROR 

Command failed with exit code 1: yarnpkg



  Error: Command failed with exit code 1: yarnpkg

  - error.js:56 makeError
    [lib]/[gatsby-cli]/[execa]/lib/error.js:56:11

  - index.js:114 handlePromise
    [lib]/[gatsby-cli]/[execa]/index.js:114:26

  - next_tick.js:68 process._tickCallback
    internal/process/next_tick.js:68:7

@vinceumo Can you create separate issue for yours? It doesn't seem related to SSL issues

@vinceumo Can you add bit more context? Are you also in similar scenario as @ilanah ?

inside an organization firewall

The sharp version was out for some time, so it's not likely something new happened there.

There is general issue about self signed certificate in certificate chain error happening in node-gyp and corporate proxy is at least mentioned once there, so this might be related nodejs/node-gyp#695

They present couple of options there, so please follow the discussion and make sure you also read up on NODE_TLS_REJECT_UNAUTHORIZED=0 if you try to use (it is bypassing security stuff, which is the reason the corporate proxy was done in first place)

I don鈥檛 want to risk security so I don鈥檛 want to use this option...
Any other way to solve this?

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

not stale

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Hey again!

It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.
Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 馃挭馃挏

Seeing this issue too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikestopcontinues picture mikestopcontinues  路  3Comments

hobochild picture hobochild  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

jimfilippou picture jimfilippou  路  3Comments

theduke picture theduke  路  3Comments