"ionic serve" command does not work in Windows environment
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Tái hiện lỗi bằng cách chạy ionic serve --verbose trong Windows cmd.exe, sau đó so sánh với lệnh trực tiếp đang hoạt động ng run app:serve --host=0.0.0.0 --port=8100. Theo dõi lời gọi tiến trình ionic serve và cách xử lý trên Windows; hoàn tất khi ionic serve khởi động thành công mà không yêu cầu sh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description:
I am having an error running the simple command of ionic serve natively in Windows. However, ionic cordova build android works fine in the same shell. This is the error that running ionic serve in cmd.exe gives:
ionic serve
> ng run app:serve --host=0.0.0.0 --port=8100
[ng] 'sh' is not recognized as an internal or external command,
[ng] operable program or batch file.
However, running ng run app:serve --host=0.0.0.0 --port=8100 directly works just fine...
The ionic serve command also works properly in Linux through WSL, however, the problem with that approach is that node-sass has to be recompiled with Linux bindings to do this.
Steps to Reproduce:
- Start a new project with
ionic startvia cmd.exe in Windows (with all pre-requisites already successfully installed and configured) - Try to serve up the App with
ionic serve - Note the error
Output:
Below is the more detailed error log running ionic serve --verbose. As can be seen in the log, windows: true is set. However, for some reason, ionic-cli is still trying to execute sh commands in a windows environment?
ionic serve --verbose
ionic:lib Terminal info: { tty: true, ci: false, windows: true } +0ms
ionic:lib CLI global options: { _: [ 'serve' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +9ms
ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
ionic:lib:project Project details: { configPath: 'C:\\Users\\json\\Projects\\test\\ionic.config.json', errors: [], context: 'app', type: 'angular' } +2ms
ionic Context: { binPath: 'C:\\Users\\json\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath: 'C:\\Users\\json\\AppData\\Roaming\\npm\\node_modules\\ionic', execPath: 'C:\\Users\\json\\Projects\\test', version: '4.10.2' } +0ms
ionic:lib:telemetry Sending telemetry for command: 'ionic serve' [ '--verbose', '--interactive', '--color' ] +0ms
ionic:lib:hooks Looking for ionic:serve:before npm script. +0ms
ionic:utils-network checking for open port on 0.0.0.0:8100 +0ms
ionic:utils-network checking for open port on fe80::6187:39a0:932:443b:8100 +12ms
ionic:utils-network checking for open port on 169.254.68.59:8100 +2ms
ionic:utils-network checking for open port on fe80::2174:5154:8963:7486:8100 +2ms
ionic:utils-network checking for open port on 192.168.0.30:8100 +4ms
ionic:utils-network checking for open port on ::1:8100 +2ms
ionic:utils-network checking for open port on 127.0.0.1:8100 +1ms
ionic:lib:serve Looking for ionic:serve npm script. +0ms
> ng run app:serve --host=0.0.0.0 --port=8100
[ng] 'sh' is not recognized as an internal or external command,
[ng] operable program or batch file.
ionic:lib:serve received unexpected close for ng (code: 1) +64ms
[ERROR] ng has unexpectedly closed (exit code 1).
The Ionic CLI will exit. Please check any output above for error details.
ionic:cli-framework:utils:process onBeforeExit handler: process.exit received +0ms
ionic:cli-framework:utils:process onBeforeExit handler: running 1 functions +1ms
ionic:cli-framework:utils:process error while killing process tree for 14276: { Error: Command failed: taskkill /pid 14276 /T /F
ionic:cli-framework:utils:process ERROR: The process "14276" not found.
ionic:cli-framework:utils:process
ionic:cli-framework:utils:process at ChildProcess.exithandler (child_process.js:297:12)
ionic:cli-framework:utils:process at ChildProcess.emit (events.js:197:13)
ionic:cli-framework:utils:process at maybeClose (internal/child_process.js:978:16)
ionic:cli-framework:utils:process at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
ionic:cli-framework:utils:process killed: false,
ionic:cli-framework:utils:process code: 128,
ionic:cli-framework:utils:process signal: null,
ionic:cli-framework:utils:process cmd: 'taskkill /pid 14276 /T /F' } +93ms
ionic:cli-framework:utils:process onBeforeExit handler: error from function: { Error: Command failed: taskkill /pid 14276 /T /F
ionic:cli-framework:utils:process ERROR: The process "14276" not found.
ionic:cli-framework:utils:process
ionic:cli-framework:utils:process at ChildProcess.exithandler (child_process.js:297:12)
ionic:cli-framework:utils:process at ChildProcess.emit (events.js:197:13)
ionic:cli-framework:utils:process at maybeClose (internal/child_process.js:978:16)
ionic:cli-framework:utils:process at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
ionic:cli-framework:utils:process killed: false,
ionic:cli-framework:utils:process code: 128,
ionic:cli-framework:utils:process signal: null,
ionic:cli-framework:utils:process cmd: 'taskkill /pid 14276 /T /F' } +4ms
ionic:cli-framework:utils:process onBeforeExit handler: exiting (exit code 1) +2ms
My ionic info:
Ionic:
ionic (Ionic CLI) : 4.10.2 (C:\Users\json\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.0.1
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.3.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 4 other plugins)
System:
Android SDK Tools : 26.1.1 (C:\Users\json\AppData\Local\Android\Sdk)
NodeJS : v11.9.0 (C:\Program Files\nodejs\node.exe)
npm : 6.5.0
OS : Windows 10
- Ngôn ngữ chính
- TypeScript
- Star
- 2k
- Fork
- 681
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ionic-team/ionic-cli
-
triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
ionic-team/ionic-cli#5016 ·
-
ionic-cli development status Đang mởtriage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
ionic-team/ionic-cli#5131 ·
-
triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
ionic-team/ionic-cli#5130 ·
-
triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
ionic-team/ionic-cli#5129 ·
-
triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
ionic-team/ionic-cli#5127 · 2 bình luận ·
Tất cả issue của ionic-team/ionic-cli
Issue tương tự
-
comp/desktop P3 type/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
NousResearch/hermes-agent#118866 ·
-
Browser Waiting for: Product Owner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
getsentry/sentry-javascript#24577 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agilepathway/label-checker#640 ·
-
Plugin stuck at "loading" on DSH 0.1.6-alpha.2 — turnTail list slot registration missing options.id Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Add 2021 Cup data to website Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
chrisparsons83/flexspotff#153 ·