loopbackio / loopbackio/loopback-next

lb4 app Command failing on windows OS

Open
#8,247 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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
![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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.