작성
·
1.4K
0
section11 내에 npx create-react-app .
터미널에 명령어 치면 오류가 납니다...ㅠ
무슨 문제일까요?
pm ERR! A complete log of this run can be found in:
npm ERR! /Users/hwji/.npm/_logs/2023-05-29T10_29_18_773Z-debug-0.log
hwji@ji-MacBook-Air section11 % npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-templa
hwji@ji-MacBook-Air section11 % npm i
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/hwji/Downloads/onebite-typescript/section11/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/hwji/Downloads/onebite-typescript/section11/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hwji/.npm/_logs/2023-05-29T10_29_43_763Z-debug-0.log
hwji@ji-MacBook-Air section11 % npx create-react-app .
The directory . contains files that could conflict:
package-lock.json
Either try using a new directory name, or remove the files listed above.
hwji@ji-MacBook-Air section11 % rm package-lock.json
hwji@ji-MacBook-Air section11 % npx create-react-app .
Creating a new React app in /Users/hwji/Downloads/onebite-typescript/section11.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code EACCES
npm ERR! syscall link
npm ERR! path /Users/hwji/.npm/_cacache/tmp/ad0df713
npm ERR! dest /Users/hwji/.npm/_cacache/content-v2/sha512/22/eb/ce31d78e398d97e2144d013ea4c1b78fb4adb5054cab00480b2af88bf292fa00411551572ab5174dfc725704b1886edf53dc44e65d19c579d45199035363
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 501:20 "/Users/hwji/.npm"
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hwji/.npm/_logs/2023-05-29T10_30_33_772Z-debug-0.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Done.
hwji@ji-MacBook-Air section11 %
답변 2
0
해당 명령어로 설치가 되지 않으신다면
section11 폴더를 삭제하신 다음
그 상위 폴더에서 sudo npx create-react-app section11 를 이용하시면 됩니다.
0
안녕하세요 이정환입니다.
해당 오류는 터미널의 경로가 잘못되었거나
혹은 잘못된 환경 변수 선언이 이루어졌을 경우에 발생합니다.
혹시 가능하시면 에러가 발생한 터미널을 스크린샷으로 올려주시면 감사하겠습니다.
네넵 알려주셔서감사합니다ㅠㅠㅠ
vscode 에러를 계쏙 chat gpt로 검색해서 해결했었습니다..! 리액트에 이어 타입스크립트도 완강 직전입니다. 좋은 강의 감사합니다!!