loopbackio / loopbackio/loopback-next

lb4 app Command failing on windows OS

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

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

bug
主要言語
TypeScript
スター
5.1k
フォーク
1.1k
平均マージ
2日 21時間
マージ済み PR(30日)
27

説明

### Describe the bug

As a developer I want to quickly scaffold an application. For this I'm using getting started docs https://loopback.io/doc/en/lb4/Getting-started.html

Installed node.js version 17.3.1 and loopback4 cli too npm i -g @loopback/cli

When I run the lb4 app command and provide the details in the CLI, the application scaffolding fails. Tried with all features, no features and selected features too. Didn't worked.

By features I mean
![image](https://user-images.githubusercontent.com/36616825/149937978-b4bb657f-55f5-4df6-a910-5da41837faa7.png)

CLI used are gitbash, windows CMD, vscode Terminal [ did not worked in any of the CLI too]

### Logs

```shell
D:\projects\test-projects\loopBack4>lb4 app
? Project name: blog
? Project description: blog application
? Project root directory: blog
? Application class name: BlogApplication
? Select features to enable in the project Enable eslint, Enable prettier, Enable mocha, Enable loopbackBuild, Enable vscode, Enable docker, Enable repositories, Enable services
node:events:368
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, scandir 'D:\projects\test-projects\loopBack4\blog\_.gitignore'
at Object.readdirSync (node:fs:1392:3)
at exports.readdir (C:\Users\sekh.ismail\nvm\v17.3.1\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\sync\fs.js:18:20)
at Object.safeCall [as safe] (C:\Users\sekh.ismail\nvm\v17.3.1\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\call.js:24:8)
at DirectoryReader.readNextDirectory (C:\Users\sekh.ismail\nvm\v17.3.1\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\directory-reader.js:78:10)
at Readable.DirectoryReader.stream._read (C:\Users\sekh.ismail\nvm\v17.3.1\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\directory-reader.js:57:18)
at Readable.read (node:internal/streams/readable:496:27)
at readdirSync (C:\Users\sekh.ismail\nvm\v17.3.1\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\sync\index.js:27:21)
at Function.readdirSyncStat (C:\Users\sekh.ismail\nvm\v17.3.1\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\index.js:34:10)
at ReaderSync.dynamicApi (C:\Users\sekh.ismail\nvm\v17.3.1\node_modules\@loopback\cli\node_modules\yeoman-generator\node_modules\fast-glob\out\providers\reader-sync.js:64:24)
at ReaderSync.api (C:\Users\sekh.ismail\nvm\v17.3.1\node_modules\@loopback\cli\node_modules\yeoman-generator\node_modules\fast-glob\out\providers\reader-sync.js:56:25)
Emitted 'error' event on Readable instance at:
at emitErrorNT (node:internal/streams/destroy:164:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4058,
syscall: 'scandir',
code: 'ENOENT',
path: 'D:\\projects\\test-projects\\loopBack4\\blog\\_.gitignore'
}

Node.js v17.3.1
```

### Additional information

With all features selected
![image](https://user-images.githubusercontent.com/36616825/149938542-e611b589-a4cc-4b97-ad23-8d631f3bed43.png)

With selected features
![image](https://user-images.githubusercontent.com/36616825/149938645-5dac9bf3-27a5-47ad-863c-4afa5f5efe79.png)

Without any features
![image](https://user-images.githubusercontent.com/36616825/149938755-eb684466-2385-46f1-b65d-bc547b3eb8e1.png)

### Reproduction

open a cli and follow the steps on a windows 10 machine
Install node.js
then Install LoopBack 4 CLI
run lb4 app command

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

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

はじめの一歩

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

調査の方向性

Node.js 17.3.1 を使用する Windows 10 で、`lb4 app` コマンドを実行し、各機能の選択を試して失敗を再現します。`@loopback/cli`、`@mrmlnc/readdir-enhanced`、`yeoman-generator`、`fast-glob` を通るスタックトレースから始めます。`_.gitignore` の ENOENT エラーなしでスキャフォールディングが完了すれば完了です。

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

評価

技術スタック
node.js, typescript
領域
cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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