loopbackio / loopbackio/loopback-next
lb4 app Command failing on windows OS
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
### 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

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

With selected features

Without any features

### 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure on Windows 10 with Node.js 17.3.1 by running the `lb4 app` command and trying each feature selection. Start with the stack trace through `@loopback/cli`, `@mrmlnc/readdir-enhanced`, `yeoman-generator`, and `fast-glob`; done means scaffolding completes without the `_.gitignore` ENOENT error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100