inflearn logo
강의

Course

Instructor

Bite-Sized React (React.js): From the Basics to Real-World Practice

12.18) Preparing for Deployment

serve -s build가 되지 않습니다..

1030

HongWon Kim

4 asked

0

Windows PowerShell

Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\PC\Desktop\emotion diary> npm install -g serve

changed 89 packages, and audited 90 packages in 10s

23 packages are looking for funding

run npm fund for details

PS C:\Users\PC\Desktop\emotion diary> cd hello

PS C:\Users\PC\Desktop\emotion diary\hello> serve -g build

serve : 이 시스템에서 스크립트를 실행할 수 없으므로 C:\Users\PC\AppData\Roaming\npm\ser

ve.ps1 파일을 로드할 수 없습니다. 자세한 내용은 about_Execution_Policies(https://go.mic

rosoft.com/fwlink/?LinkID=135170)를 참조하십시오.

위치 줄:1 문자:1

+ serve -g build

+ ~~~~~

+ CategoryInfo : 보안 오류: (:) [], PSSecurityException

+ FullyQualifiedErrorId : UnauthorizedAccess

PS C:\Users\PC\Desktop\emotion diary\hello> npm run build

> hello@0.1.0 build

> react-scripts build

Creating an optimized production build...

Compiled with warnings.

[eslint]

src\components\DiaryItem.js

Line 32:16: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text

src\components\DiaryList.js

Line 1:15: 'useEffect' is defined but never used no-unused-vars

src\components\EmotionItem.js

Line 6:13: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text

src\pages\Diary.js

Line 20:7: React Hook useEffect has a missing dependency: 'id'. Either include it or remove the dependency array react-hooks/exhaustive-deps

Line 37:7: React Hook useEffect has a missing dependency: 'navigate'. Either include it or remove the dependency array react-hooks/exhaustive-deps

Line 58:25: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text

src\pages\Edit.js

Line 5:9: 'getStringDate' is defined but never used

no-unused-vars

Line 22:7: React Hook useEffect has a missing dependency: 'id'. Either include it or

remove the dependency array react-hooks/exhaustive-deps

Line 39:7: React Hook useEffect has a missing dependency: 'navigate'. Either include

it or remove the dependency array react-hooks/exhaustive-deps

Search for the keywords to learn more about each warning.

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

File sizes after gzip:

54.79 kB build\static\js\main.544a876e.js

1.42 kB build\static\css\main.b7fc6af2.css

The project was built assuming it is hosted at /.

The build folder is ready to be deployed.

You may serve it with a static server:

serve -s build

Find out more about deployment here:

https://cra.link/deployment

PS C:\Users\PC\Desktop\emotion diary\hello> serve -s build

serve : 이 시스템에서 스크립트를 실행할 수 없으므로 C:\Users\PC\AppData\Roaming\npm\ser

ve.ps1 파일을 로드할 수 없습니다. 자세한 내용은 about_Execution_Policies(https://go.mic

rosoft.com/fwlink/?LinkID=135170)를 참조하십시오.

위치 줄:1 문자:1

+ serve -s build

+ ~~~~~

+ CategoryInfo : 보안 오류: (:) [], PSSecurityException

+ FullyQualifiedErrorId : UnauthorizedAccess

PS C:\Users\PC\Desktop\emotion diary\hello>

 

npm install -g serve와

npm run build를 했습니다

 

you may serve it with a static server라는 메시지와함께

serve -s build라는 메세지도 떴는데

 

serve -s build라고 명령어를 입력했는데도 입력이 되지 않습니다... 루트폴더 문제인가요? 문제가 무엇인가요

react nodejs javascript

Answer 3

3

gnsl2725

vscode를 관리자 권한으로 실행해도 안되시는 분들은 vscode 터미널에 ExecutionPolicy명령어를 입력했을 때 Restricted와 같이 나오면

Set-ExecutionPolicy Unrestriced 입력 후 serve -s build 진행해보시기 바랍니다.

저는 위와 같이 진행해서 해결했습니다

1

dahye1oo2

감사합니다! 덕분에 잘 해결 할 수 있었습니다! 명령어가 바뀐건지 Set-ExecutionPolicy Unrestricted 라고 입력해야 동작이 되네요!

 

3

xoals6798572

맥쓰시는 분들도 혹시나 보실까봐 댓글 남깁니다!
https://blog.sonim1.com/125
npm install -g serve 안되시는 분들은 위에 링크 참고 하시면 됩니다! 저는 아래와 같이 작성해서 install 되었습니다!
sudo npm install -g serve 이렇게 하니깐 되었습니다!!

1

winterlood

안녕하세요 이정환입니다.

권한 관련 오류가 발생한 것 같습니다.

vscode를 관리자 권한으로 실행하신 다음 동일하게 실행 해 보시면 실행될 것으로 예상됩니다.

그래도 안 될 경우 명령 프롬프트를 관리자 권한으로 실행하여 실행해 보시기 바랍니다.

혹시 관리자 권한으로 실행하는 방법을 모르실 수 있으니 아래 링크로도 첨부 해 드릴게요!

https://extrememanual.net/40882

0

HongWon Kim

감사합니다 해결했습니다! ㅎㅎ

Editor Component의 최적화 불가능 이슈

0

37

2

useCallback ⊂ useMemo

0

34

2

라이브러리 설치 질문

0

33

2

linter 질문

0

40

2

감정일기장 vercel 배포 후 새로 고침 시 404페이지가 뜨는 이유

0

40

2

Sort 메서드 관련 아티클

0

42

2

4.1) React.js를 소개합니다 강의를 듣고 궁금한 점이 생겼습니다.

0

44

2

html, body에 적용하는 css 스타일 질문입니다.

0

38

2

eslint.config.js 설정 질문입니다.

0

90

2

존재하지 않는 일기 url입력 시 alert이 두 번 떠요

0

66

1

교재(3쇄)와 강의 내용 문의

0

65

2

12.13) 하단 여백 스타일링 관련 질문 드립니다.

0

87

2

에러 질문드립니다

0

103

2

VSCode 설정 문의

0

137

2

PPT 코드 관련 질문

0

66

2

useEffect와 lifecycle문의

0

87

2

프론트엔드 학습 수준 문의

0

107

2

리액트 챕터별 코드에서 eslint 설정파일이 없어요

0

110

2

데이터 로딩중 화면만 계속 나와요!!

0

100

2

퍼블리셔일경우 어느정도 수준까지 강의를 들어야할까요

0

129

2

이후의 커리큘럼 문의

0

151

2

실슬환경 설정에서 save후 console.log 부분이 새로고침이 안되는현상입니다.

0

106

2

최적화 관련 질문있습니다 (useMemo 등)

0

126

3

프로바이더 컴포넌트의 위치는 어떤 기준인가요?

1

124

3