`npm run test` does not work on Windows cmd

Đang mở
#4,886 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
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ệ
shell, typescript
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu với script kiểm thử mặc định do ionic start tạo ra và so sánh cách Windows cmd phân tích đối số react-scripts của script này. Tái hiện lỗi bằng npm run test trên Windows, sau đó xác minh rằng script mặc định đã được sửa chạy thành công mà không có các lỗi command hoặc EPIPE được hiển thị ở đây.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

triage

Description:

Default script of npm run test does not work on Windows cmd.

"test": "react-scripts test --transformIgnorePatterns 'node_modules/blahblah...'"

I think the reason is that Windows cmd can't handle single quoted arguments.
The script works when I replace the single quotes with the double quotes.

"test": "react-scripts test --transformIgnorePatterns \"node_modules/blahblah...\""

Steps to Reproduce:

  • Create a project using ionic start
  • Run npm run test

Output:

> cmdtest@0.0.1 test
> react-scripts test --transformIgnorePatterns 'node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons)/)'

'stencil'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다.
(=> This sentence means 'stencil' is not a command or an executable)
[ERROR] Unable to find command: /core
[ERROR] Unable to find command: /react-router
node:events:498
      throw er; // Unhandled 'error' event
      ^

Error: EPIPE: broken pipe, write
...

My ionic info:

Ionic:

   Ionic CLI       : 6.20.1 (C:\Users\mathe\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework : @ionic/react 6.1.13

Capacitor:

   Capacitor CLI      : 3.6.0
   @capacitor/android : not installed
   @capacitor/core    : 3.6.0
   @capacitor/ios     : not installed

Utility:

   cordova-res : not installed globally
   native-run  : 1.6.0

System:

   NodeJS : v16.14.0 (C:\Program Files\nodejs\node.exe)
   npm    : 8.3.1
   OS     : Windows 10

Other Information:

None

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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ionic-team/ionic-cli

Tất cả issue của ionic-team/ionic-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.