We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
需要依序安裝的有 curl, Node.js (和 npm), live-server
Ctrl + Alt + T
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g live-server
TodoApp
index.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Examples</title> <meta name="description" content=""> <meta name="keywords" content=""> <link href="" rel="stylesheet"> </head> <body> <div>Hello, world!</div> </body> </html>
Terminal 切換路徑到上述 index.html 檔案所在路徑 ( 在此例為 cd 桌面/TodoApp/ ),輸入命令live-server,將會啟動伺服器,開啟瀏覽器,前往 http://localhost:8080 , index.html 檔案會顯示Hello, world!在網頁上。
cd 桌面/TodoApp/
live-server
如果出現Error: listen EACCES {{path}}:{{port}}錯誤訊息,可能是該port被本機其他伺服器佔據了,請換其他port,比如 live-server --host=127.0.0.1 --port=1234 註: EACCES (aka "Permission denied")
Error: listen EACCES {{path}}:{{port}}
live-server --host=127.0.0.1 --port=1234
如果出現'live-server' 不是內部或外部命令、可執行的程式或批次檔。(live-server: command not found) 請檢查環境變數 PATH的設定值。(Windows 裡應加入 ;C:\Program Files\nodejs;%AppData%\npm;)
'live-server' 不是內部或外部命令、可執行的程式或批次檔。
PATH
;C:\Program Files\nodejs;%AppData%\npm;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
live-server 的用途:
安裝
需要依序安裝的有 curl, Node.js (和 npm), live-server
Ctrl + Alt + T
, 開啟 Terminal, 輸入下列指令sudo apt install curl
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g live-server
TodoApp
, 用 sublime (或其他文字編輯器) 建一個index.html
檔案,內容為:Terminal 切換路徑到上述
index.html
檔案所在路徑 ( 在此例為cd 桌面/TodoApp/
),輸入命令live-server
,將會啟動伺服器,開啟瀏覽器,前往 http://localhost:8080 ,index.html
檔案會顯示Hello, world!在網頁上。如果出現
Error: listen EACCES {{path}}:{{port}}
錯誤訊息,可能是該port被本機其他伺服器佔據了,請換其他port,比如live-server --host=127.0.0.1 --port=1234
註: EACCES (aka "Permission denied")
如果出現
'live-server' 不是內部或外部命令、可執行的程式或批次檔。
(live-server: command not found) 請檢查環境變數PATH
的設定值。(Windows 裡應加入;C:\Program Files\nodejs;%AppData%\npm;
)The text was updated successfully, but these errors were encountered: