[React] npm / yarn 설치 오류 error An unexpected error occurred

2019. 3. 25. 13:41
반응형


[react] npm / yarn 설치 오류 error An unexpected error occurred




리액트 뿐만아니라 NPM / YARN 설치시에


error An unexpected error occurred: "https://registry.yarnpkg.com/react: self signed certificate in certificate chain".


등이 오류 가 발생 할수도있다 혹은 오류들로 메시지가 발생 할 수도있는데.


해당문제는 SSL 문제이다. 


해결방법을 알아보도록하자.




▼npm 오류


1
2
3
4
5
6
7
8
9
#npm 으로 리액트등을 설치 리액트뿐만아니라 npm 설치시 
>npm install -g create-react-app
 
npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npmjs.org/create-react-app failed, reason: self signed certificate in certificate chain
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\경로\AppData\Roaming\npm-cache\_logs\짜날-25T02_04_27_316Z-debug.log
 
cs



▼npm 해결


1
2
3
4
5
6
7
8
9
10
 
#해결방법 npm strict-ssl
>npm config set strict-ssl false
>npm install -g create-react-app
 
경로\create-react-app -> 경로\Roaming\npm\node_modules\create-react-app\index.js
+ create-react-app@2.1.8
added 63 packages from 20 contributors in 4.434s
 
 
cs



▼yarn 오류


1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
>create-react-app hello-react
 
Creating a new React app in 경로\hello-react.
 
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
 
yarn add v1.15.2
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/react: self signed certificate in certificate chain".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\n9631\\Desktop\\react\\hello-react\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
 
cs


▼npm 해결


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
>yarn config set "strict-ssl" false
yarn config v1.15.2
success Set "strict-ssl" to "false".
Done in 0.07s.
 
경로>create-react-app hello-react
 
Creating a new React app in 경로\hello-react.
 
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
 
yarn add v1.15.2
[1/4] Resolving packages.....
cs


반응형

BELATED ARTICLES

more