npm 运行 dev --host 网络:未公开

npm run dev --host network: not exposed

我想使用 npm run dev --host 命令在 LAN 上公开我的 svelte 应用程序,但它显示:

> frontend@0.0.1 dev
> svelte-kit dev


  SvelteKit v1.0.0-next.295

  local:   http://localhost:3000
  network: not exposed

  Use --host to expose server to other devices on this network


您必须在实际标志前添加 --

npm run dev -- --host

它应该输出:

> project@0.0.1 dev
> svelte-kit dev "--host"


  SvelteKit v1.0.0-next.316

  local:   http://localhost:3000
  network: http://***.***.**.**:3000

  Note that all files in the following directories will be accessible to anyone on your network: src/lib, src/routes, .svelte-kit, src, node_modules