• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    미해결

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

22.10.04 11:16 작성 조회수 641

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라고 명령어를 입력했는데도 입력이 되지 않습니다... 루트폴더 문제인가요? 문제가 무엇인가요

답변 3

·

답변을 작성해보세요.

3

gnsl2725님의 프로필

gnsl2725

2023.08.23

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

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

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

dahye1oo2님의 프로필

dahye1oo2

2023.12.14

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

 

3

강태민님의 프로필

강태민

2022.11.21

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

1

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

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

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

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

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

https://extrememanual.net/40882

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