loopbackio / loopbackio/loopback-next

lb4 app Command failing on windows OS

Offen
#8,247 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
TypeScript
Sterne
5.1k
Forks
1.1k
Ø Merge
2 T. 21 Std.
Gemergte PRs (30 T.)
27

Beschreibung

### 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere den Fehler unter Windows 10 mit Node.js 17.3.1, indem du den Befehl `lb4 app` ausführst und jede Funktionsauswahl ausprobierst. Beginne mit dem Stacktrace durch `@loopback/cli`, `@mrmlnc/readdir-enhanced`, `yeoman-generator` und `fast-glob`; abgeschlossen ist die Aufgabe, wenn das Scaffolding ohne den `_.gitignore`-ENOENT-Fehler abgeschlossen wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
node.js, typescript
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.