Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to verify the first certificate #1982

Closed
sanphandinh opened this issue Oct 6, 2017 · 5 comments
Closed

unable to verify the first certificate #1982

sanphandinh opened this issue Oct 6, 2017 · 5 comments

Comments

@sanphandinh
Copy link

When I run getstorybook command in create-react-app project. It can't work and show message:
"Adding storybook support to your "Create React App" based project(node:9436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): RequestError: un
able to verify the first certificate"

@danielduan
Copy link
Member

can you post the full error log?

It sounds like there might be a certificate issue with npm install. You might be using an internal npm server or perhaps behind a corporate firewall that messes with npm downloads?

@Zeophlite
Copy link

I have the same issue, and I'm behind a corporate firewall. npm install works correctly (I have used npm config set proxy )

$ getstorybook

 getstorybook - the simplest way to add a storybook to your project.

 • Detecting project type. ✓
 • Adding storybook support to your "Create React App" based project(node:14192) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): RequestError: connect ETIMEDOUT 151.101.76.162:80
(node:14192) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@alexlurvey
Copy link

alexlurvey commented Oct 24, 2017

I've been trying to work around this. I'm on node v8.6.0. It seems like the problem is when latest-version tries tries to require packages in storybook's generators. I added a catch block to latest-version's index.js file where storybook was installed globally.

<npm-global-dir>/lib/node_modules/@storybook/cli/node_modules/latest-version/index.js

  • module.exports = name => packageJson(name.toLowerCase()).then(data => data.version).catch(e => console.log(e));

This allowed allowed the getstorybook command to complete and 'yarn run storybook' loads the page. Not sure if anything would be broken since I've never used storybook before.

So a workaround to run the command would be either adding that catch block or running the following as a replacement to getstorybook:
NODE_TLS_REJECT_UNAUTHORIZED=0 node <npm-global-dir>/lib/node_modules/@storybook/cli/bin/generate.js

Although, using the cafile I use for npm would be ideal.

@arikaa
Copy link

arikaa commented Oct 26, 2017

I added the solution @alexlurvey created and was able to run storybook!

@stale
Copy link

stale bot commented Dec 11, 2017

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants