iT邦幫忙

0

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

  • 分享至 

  • xImage

執行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:

  bit.ly/CRA-deploy

PS D:\react\my-app> serve -s build
serve : 因為這個系統上已停用指令碼執行,所以無法載入 C:\Users\jbudu\AppData\Roaming\npm\serve.ps1 檔案。如需詳細資訊,請參閱 a
bout_Execution_Policies,網址為 https:/go.microsoft.com/fwlink/?LinkID=135170。
位於 線路:1 字元:1
+ serve -s build
+ ~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
jbuduoo iT邦新手 4 級 ‧ 2020-09-01 20:29:43 檢舉
用管理者權限進入vs
執行:Set-ExecutionPolicy RemoteSigned
```
PS D:\react\my-app> Set-ExecutionPolicy RemoteSigned
PS D:\react\my-app> serve -s build
```
jbuduoo iT邦新手 4 級 ‧ 2020-09-01 20:30:31 檢舉
想要使用 cli指令 發生 "因為這個系統上已停用指令碼執行,所以無法載入 C:\Users\user\AppData\Roaming\npm\ng.ps1 檔案"
https://dotblogs.com.tw/initials/2019/12/10/115640
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答