本地电脑静态资源访问服务

  |  

安装

npm i serve -g

##
启动服务

serve

1
2
3
4
5
6
7
8
9
10
11
C:\Users\klover\Downloads>serve
┌───────────────────────────────────────────────────┐
│ │
│ Serving! │
│ │
│ - Local: http://localhost:5000 │
│ - On Your Network: http://192.168.3.213:5000 │
│ │
│ Copied local address to clipboard! │
│ │
└───────────────────────────────────────────────────┘

出现的问题:

1
2
3
4
5
6
7
8
PS C:\Users\klover\Downloads> serve
serve : 无法加载文件 C:\Users\klover\AppData\Roaming\npm\serve.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https
:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ serve
+ ~~~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess

出现上述问题
在命令窗口输入 cmd 出现下面输出

1
2
3
4
5
6
7
8
Path
----
C:\Users\klover\Downloads


PS C:\Users\klover\Downloads> cmd
Microsoft Windows [版本 10.0.18362.1016]
(c) 2019 Microsoft Corporation。保留所有权利。

在 运行 serve

文章目录
  1. 1. 安装