Skip to content
New issue

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

能否跳过build后自动打开浏览器的行为? #5831

Closed
owendswang opened this issue Jan 22, 2023 · 2 comments
Closed

能否跳过build后自动打开浏览器的行为? #5831

owendswang opened this issue Jan 22, 2023 · 2 comments
Labels

Comments

@owendswang
Copy link

owendswang commented Jan 22, 2023

Summary | 概述

启动dev server时,build结束会自动调用打开浏览器,可我是远程的无图形界面的服务器跑dev server进行开发,如何才能跳过打开浏览器的行为?报错后dev server无法启动完成。

Motivation | 背景

远程的无图形界面的服务器跑dev server,无法打开浏览器,无法跑起dev server。

Usage example | 使用示例

> npm run start
报错:
`ice.js 2.6.6
Proxy setting detected. HTTPS will be downgraded to TLS only (HTTP/2 will be disabled)

Local: http://localhost:3333/
Network: http://10.70.2.151:3333/
Network: http://172.17.0.1:3333/
node:events:491
throw er; // Unhandled 'error' event
^

Error: spawn xdg-open ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn xdg-open',
path: 'xdg-open',
spawnargs: [ 'http://localhost:3333/' ]
}

Node.js v18.12.1`

Detailed design | 方案设计

配置文件内是否可以设置跳过打开浏览器的行为?

Additional context | 额外信息

ice.js 2.6.6
Ubuntu Server 22.04
Node.js 18.12.1

@owendswang owendswang added the rfc label Jan 22, 2023
@ClarkXia
Copy link
Collaborator

ClarkXia commented Jan 30, 2023

https://v2.ice.work/docs/guide/basic/build#start
通过 cli 的 --disable-open 禁止默认打开浏览器的行为

@owendswang
Copy link
Author

https://v2.ice.work/docs/guide/basic/build#start 通过 cli 的 --disable-open 禁止默认打开浏览器的行为

哇,是我疏忽了,十分感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants