`npm run test` does not work on Windows cmd

オープン
#4,886 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
shell, typescript
領域
cli

調査の方向性

ionic start によって生成されたデフォルトのテストスクリプトから始め、その react-scripts 引数が Windows cmd によってどのように解析されるかを比較します。Windows で npm run test を実行して失敗を再現し、修正されたデフォルトスクリプトが、ここに示されている command または EPIPE エラーなしで正常に実行されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
2k
フォーク
681
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ionic-team/ionic-cli のほかの issue

ionic-team/ionic-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。