serve : 因為這個系統上已停用指令碼執行,所以無法載入 C:\Users\jbudu\AppData\Roaming\npm\serve.ps1 檔案

執行serve -s build錯誤訊息

PS D:\react\my-app> npm run build

> my-app@0.1.0 build D:\react\my-app
> react-scripts build

Creating an optimized production build...
Compiled successfully.

  39.39 KB  build\static\js\2.763b34e5.chunk.js
  772 B     build\static\js\runtime-main.83c3e0c4.js
  645 B     build\static\js\main.ed0de294.chunk.js
  547 B     build\static\css\main.5f361e03.chunk.css

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

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:

PS D:\react\my-app> serve -s build
serve : 因為這個系統上已停用指令碼執行,所以無法載入 C:\Users\jbudu\AppData\Roaming\npm\serve.ps1 檔案。如需詳細資訊,請參閱 a
bout_Execution_Policies,網址為 https:/。
位於 線路:1 字元:1
+ serve -s build
+ ~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
jbuduoo iT邦新手 5 級 ‧ 2020-09-01 20:29:43 檢舉
執行:Set-ExecutionPolicy RemoteSigned
PS D:\react\my-app> Set-ExecutionPolicy RemoteSigned
PS D:\react\my-app> serve -s build
jbuduoo iT邦新手 5 級 ‧ 2020-09-01 20:30:31 檢舉
想要使用 cli指令 發生 "因為這個系統上已停用指令碼執行,所以無法載入 C:\Users\user\AppData\Roaming\npm\ng.ps1 檔案"