当前位置:网站首页>Live server usage

Live server usage

2022-07-07 23:31:00 gaojingsong

PS D:\web001\vue001> live-server
live-server : Cannot be “live-server” Item identified as cmdlet、 function 、 The name of the script file or runnable program . Please check the spelling of the name , If the path is included , Please make sure the path is correct , then try again .
The position of That's ok :1 character : 1
+ live-server
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (live-server:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 

PS D:\web001\vue001> npm install -g live-server
npm WARN deprecated [email protected]: The package has been renamed to `open`
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
D:\node\node-v14.19.0-win-x64\live-server -> D:\node\node-v14.19.0-win-x64\node_modules\live-server\live-server.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.2.7 (node_modules\live-server\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ [email protected]
added 195 packages from 149 contributors in 44.98s
PS D:\web001\vue001> live-server
live-server : Unable to load file D:\node\node-v14.19.0-win-x64\live-server.ps1, Because scripts are not allowed to run on this system . For more information , see also https:/go.microsoft.com/fwlink/?LinkID=13
5170 Medium about_Execution_Policies.
The position of That's ok :1 character : 1
+ live-server
+ ~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
PS D:\web001\vue001> set-ExecutionPolicy RemoteSigned
set-ExecutionPolicy : For registry keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell” Access to was denied for . To change the default (LocalMachine) Scoped
Execution strategy , Please use “ Run as administrator ” Option to start the Windows PowerShell. To change the execution policy of the current user , Please run "Set-ExecutionPolicy -Scope CurrentUser".
The position of That's ok :1 character : 1
+ set-ExecutionPolicy RemoteSigned
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
PS D:\web001\vue001> Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
PS D:\web001\vue001> live-server
Serving "D:\web001\vue001" at http://127.0.0.1:8080
Ready for changes
GET /favicon.ico 404 3.955 ms - 150
GET /favicon.ico 404 1.370 ms - 150

PS D:\web001\vue001> live-server --port 9000
Serving "--port" at http://127.0.0.1:8080
Ready for changes
GET / 404 9.740 ms - 139

PS D:\web001\vue001> live-server --help
Usage: live-server [-v|--version] [-h|--help] [-q|--quiet] [--port=PORT] [--host=HOST] [--open=PATH] [--no-browser] [--browser=BROWSER] [--ignore=PATH] [--ignorePattern=RGXP] [--no-css-inject] [--entry-file=PATH] [--spa] [--mount=ROUTE:PATH] [--wait=MILLISECONDS] [--htpasswd=PATH] [--cors] [--https=PATH] [--https-module=MODULE_NAME] [--proxy=PATH] [PATH]
PS D:\web001\vue001> live-server -h
Usage: live-server [-v|--version] [-h|--help] [-q|--quiet] [--port=PORT] [--host=HOST] [--open=PATH] [--no-browser] [--browser=BROWSER] [--ignore=PATH] [--ignorePattern=RGXP] [--no-css-inject] [--entry-file=PATH] [--spa] [--mount=ROUTE:PATH] [--wait=MILLISECONDS] [--htpasswd=PATH] [--cors] [--https=PATH] [--https-module=MODULE_NAME] [--proxy=PATH] [PATH]
PS D:\web001\vue001>live-server --port=10010
Serving "D:\web001\vue001" at http://127.0.0.1:10010
Ready for changes
GET /favicon.ico 404 2.854 ms - 150

 

原网站

版权声明
本文为[gaojingsong]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207072054063023.html