강의

멘토링

로드맵

Inflearn brand logo image

인프런 커뮤니티 질문&답변

95010236님의 프로필 이미지
95010236

작성한 질문수

node.js 설치는 했지만 npm 실행이 안 돼요 ㅠㅠ 도와주세요

작성

·

393

·

수정됨

0

node.js 깔고 파워쉘로는 버전이 저렇게 잘 나오는데, 터미널에서 버전 치면 npm에서 저렇게 배치 파일 아니라고 한 다음에 버전이 뜹니다 ㅠㅠ 또, create-react-app 명령어 실행이 가장 밑 사진처럼 뜨면서 계속 실행이 안 되는데 어떻게 해야 하나요 ㅠㅠ 이틀째 이러네요 ㅠㅠ .... node.js도 버전 5개 정도로 다르게 다 다운했다가 삭제해도 제대로 동작이 안 되네요 ... ㅠ.ㅠ jdk는 또 어디서 튀어나오는 건지 모르겠습니다

 

0 verbose cli C:\Program Files\nodejs\node.exe C:\Users\USER\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
1 info using npm@11.0.0
2 info using node@v23.5.0
3 silly config load:file:C:\Users\USER\AppData\Roaming\npm\node_modules\npm\npmrc
4 silly config load:file:C:\Users\USER\Desktop\r\.npmrc
5 silly config load:file:C:\Users\USER\.npmrc
6 silly config load:file:C:\Users\USER\AppData\Roaming\npm\etc\npmrc
7 verbose title npm exec create-react-app my-app
8 verbose argv "exec" "--" "create-react-app" "my-app"
9 verbose logfile logs-max:10 dir:C:\Users\USER\AppData\Local\npm-cache\_logs\2024-12-30T11_35_42_456Z-
10 verbose logfile C:\Users\USER\AppData\Local\npm-cache\_logs\2024-12-30T11_35_42_456Z-debug-0.log
11 silly logfile start cleaning logs, removing 1 files
12 silly logfile done cleaning log files
13 verbose stack Error: spawn C:\Users\USER\Desktop\jdk-17.0.10+7 ENOENT
13 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:286:19)
13 verbose stack     at onErrorNT (node:internal/child_process:484:16)
13 verbose stack     at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
14 error code ENOENT
15 error syscall spawn C:\Users\USER\Desktop\jdk-17.0.10+7
16 error path C:\Users\USER\Desktop\r
17 error errno -4058
18 error enoent spawn C:\Users\USER\Desktop\jdk-17.0.10+7 ENOENT
19 error enoent This is related to npm not being able to find a file.
19 error enoent
20 verbose cwd C:\Users\USER\Desktop\r
21 verbose os Windows_NT 10.0.19045
22 verbose node v23.5.0
23 verbose npm  v11.0.0
24 verbose exit -4058
25 verbose code -4058
26 error A complete log of this run can be found in: C:\Users\USER\AppData\Local\npm-cache\_logs\2024-12-30T11_35_42_456Z-debug-0.log
image.pngimage.pngimage.png

 이후에 node.js를 18버전으로, bpm이 아닌 yarn과 함께 설치하는 것으로 다시 깔고 실행해도 여전히 정상 작동이 안 됩니다 ㅠㅠ 뭐가 문제죠 대체 ㅠㅠㅠㅠ

image.png

 

답변 1

0

안녕하세요, 인프런 AI 인턴입니다.

95010236님, Node.js 설치 및 npm 문제를 겪고 계신 것 같네요. 발생한 문제를 해결하기 위해 아래의 과정을 시도해 보세요.

  1. 경로 문제 확인: 오류 로그를 보면 특정 경로에 ENOENT 오류가 나옵니다. 이는 해당 경로에 파일이나 디렉토리를 찾지 못한 경우입니다. 오류 메시지에 나오는 C:\Users\USER\Desktop\jdk-17.0.10+7 경로가 정확히 존재하는지, 그리고 필요한 파일들이 그 안에 있는지 확인해 보세요.

  2. 환경 변수 설정:

    • 현재 PowerShell에서는 버전이 정상적으로 출력되는 것 같지만, 다른 터미널 창에서는 경로 설정 문제로 인식하지 못하는 것 같습니다. 시스템 환경 변수에 Node.js 설치 경로와 npm 경로가 제대로 등록되어 있는지 확인해 보세요.
    • Windows에서 설정 방법: 시스템 속성 -> 고급 -> 환경 변수 -> 시스템 변수 -> Path 수정에서 Node.js 설치 경로를 추가하세요.
  3. 해결되지 않으면 Node 및 npm 재설치:

    • 오래된 Node.js, npm 및 관련된 모든 설치 파일을 제거하세요.
    • 최신 LTS 버전의 Node.js를 공식 웹사이트를 통해 다운로드 받고 설치하세요.
    • (Windows 사용자라면) 설치 시 “Add to PATH” 옵션을 선택하세요.
  4. Yarn을 통한 설치 시도:

    • 이미 Yarn을 설치하셨으니 create-react-app을 글로벌로 설치한 다음 시도해볼 수 있습니다.
    • yarn global add create-react-app 명령어를 사용해 보세요.
    • 이후 yarn create react-app my-app을 다시 시도해 보세요.

출처 및 문서를 참고하시다 도움이 필요하다면 아래 링크를 참조하세요:
- Windows 환경변수 설정 방법
- Yarn 문서

위 방법들이 해결책이 되길 바랍니다! 추가적인 문제가 있거나 여러 방법을 모두 시도했으나 해결이 되지 않는다면, 문제가 발생한 구체적인 상황을 추가적으로 말씀해 주시면 더 도와드리겠습니다. 힘내세요! 🙌

95010236님의 프로필 이미지
95010236

작성한 질문수

질문하기