【发布时间】:2020-09-28 20:59:32
【问题描述】:
我已经使用以下方法安装了 json-server:
npm install -g json-server
然后我创建了一个这样的 db.json:
{
"employees": [
{
"id": 1,
"first_name": "Sebastian",
"last_name": "Eschweiler",
"email": "sebastian@codingthesmartway.com"
},
{
"id": 2,
"first_name": "Steve",
"last_name": "Palmer",
"email": "steve@codingthesmartway.com"
},
{
"id": 3,
"first_name": "Ann",
"last_name": "Smith",
"email": "ann@codingthesmartway.com"
}
]
}
我通过以下方式观看 json-server:
json-server --watch db.json
但它不起作用。终端中的消息是:
无法加载,因为在此系统上禁用了正在运行的脚本。 有关详细信息,请参阅 about_Execution_Policies,网址为 https://go.microsoft.com/fwlink/?LinkID=135170。
发生了什么?
【问题讨论】:
-
如果您转到链接并启用此docs.microsoft.com/en-gb/powershell/module/…
-
如何启用?你能帮帮我吗?
-
我已经设置好了:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -> A。但它不起作用消息:被拒绝。要更改默认 (LocalMachine) 范围的执行策略,请使用“以管理员身份运行”选项启动 Windows PowerShell。要更改当前用户的执行策略,请运行“Set-ExecutionPolicy -Scope CurrentUser”
标签: javascript json reactjs redux json-server