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

영래님의 프로필 이미지
영래

작성한 질문수

따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]

[HPM] Error occurred while trying to proxy request /api/users/auth from localhost:3000 to http://localhost:5000 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

작성

·

334

0

안녕하십니까

아래와 같은 에러가 발생해서 문의드립니다.

PS C:\Users\User\Desktop\boilerplate-mern-stack-master> npm run dev

 

> react-boiler-plate@1.0.0 dev C:\Users\User\Desktop\boilerplate-mern-stack-master

> concurrently "npm run backend" "npm run start --prefix client"

 

[0] 

[0] > react-boiler-plate@1.0.0 backend C:\Users\User\Desktop\boilerplate-mern-stack-master

[0] > nodemon server/index.js

[0] 

[1] 

[1] > client@0.1.0 start C:\Users\User\Desktop\boilerplate-mern-stack-master\client       

[1] > react-scripts start

[1] 

[0] [nodemon] 1.19.4

[0] [nodemon] to restart at any time, enter `rs`

[0] [nodemon] watching dir(s): *.*

[0] [nodemon] watching extensions: js,mjs,json

[0] [nodemon] starting `node server/index.js`

[0] C:\Users\User\Desktop\boilerplate-mern-stack-master\server\routes\product.js:10

[0] var storage = multer.diskStorage({//어디에 파일이 저장되는지

[0]               ^

[0]

[0] ReferenceError: multer is not defined

[0]     at Object.<anonymous> (C:\Users\User\Desktop\boilerplate-mern-stack-master\server\routes\product.js:10:15)

[0]     at Module._compile (internal/modules/cjs/loader.js:1072:14)

[0]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)

[0]     at Module.load (internal/modules/cjs/loader.js:937:32)

[0]     at Function.Module._load (internal/modules/cjs/loader.js:778:12)

[0]     at Module.require (internal/modules/cjs/loader.js:961:19)

[0]     at require (internal/modules/cjs/helpers.js:92:18)

[0]     at Object.<anonymous> (C:\Users\User\Desktop\boilerplate-mern-stack-master\server\index.js:39:25)

[0]     at Module._compile (internal/modules/cjs/loader.js:1072:14)

[0]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)

[0]     at Module.load (internal/modules/cjs/loader.js:937:32)

[0]     at Function.Module._load (internal/modules/cjs/loader.js:778:12)

[0]     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)

[0]     at internal/main/run_main_module.js:17:47

[0] [nodemon] app crashed - waiting for file changes before starting...

[1] [HPM] Proxy created: /  -> http://localhost:5000

[1] i 「wds」: Project is running at http://192.168.0.3/

[1] i 「wds」: webpack output is served from

[1] i 「wds」: Content not from webpack is served from C:\Users\User\Desktop\boilerplate-mern-stack-master\client\public

[1] i 「wds」: 404s will fallback to /

[1] Starting the development server...

[1]

[1] Browserslist: caniuse-lite is outdated. Please run:

[1] npx browserslist@latest --update-db

[1] Compiled with warnings.

[1]

[1] ./src/components/views/UploadProductPage/UploadProductPage.js

[1]   Line 2:10:   'Typography' is defined but never used          no-unused-vars

[1]   Line 3:10:   'Item' is defined but never used                no-unused-vars

[1]   Line 26:12:  'Images' is assigned a value but never used     no-unused-vars

[1]   Line 26:20:  'setImages' is assigned a value but never used  no-unused-vars

[1]

[1] ./src/components/views/LoginPage/LoginPage.js

[1]   Line 74:11:  'dirty' is assigned a value but never used        no-unused-vars

[1]   Line 79:11:  'handleReset' is assigned a value but never used  no-unused-vars

[1]

[1] ./src/components/views/RegisterPage/RegisterPage.js

[1]   Line 92:11:  'dirty' is assigned a value but never used        no-unused-vars

[1]   Line 97:11:  'handleReset' is assigned a value but never used  no-unused-vars

[1]

[1] Search for the keywords to learn more about each warning.

[1] To ignore, add // eslint-disable-next-line to the line before.

[1]

[1] [HPM] Error occurred while trying to proxy request /api/users/auth from localhost:3000 to http://localhost:5000 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

 

 

-------------------------------------------------------------------------------------------------

npm install bcrypt --save 이것도 해보고

bcryptjs를 받아 const bcrypt = require('bcryptjs') 이렇게도 해봤는데 위와 같은 오류가 발생합니다.

 

브라우저 console창에는

Failed to load resource: the server responded with a status of 504 (Gateway Timeout) 

에러가 발생합니다.

확인부탁드립니다.

 

 

 

 

답변 1

0

John Ahn님의 프로필 이미지
John Ahn
지식공유자

안녕하세요 ! 

로그를 보니깐 bcrypt 문제가 아닌 

[0] ReferenceError: multer is not defined

multer 문제인것 같습니다. 

multer 모듈을 설치하셨다면 

사용하실 파일에서  multer를 import 해주신 후 사용해주세요 ~!

 

영래님의 프로필 이미지
영래
질문자

감사합니다!

영래님의 프로필 이미지
영래

작성한 질문수

질문하기