Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitignore error while creating loopbackjs app

I downloaded loopbackjs on my windows using the npm command. But while creating an app there is an error showing constantly.

node:events:368


throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, scandir 'C:\Users\Rohit Pandey\rohit-pandey\_.gitignore'
    at Object.readdirSync (node:fs:1390:3)
    at exports.readdir (C:\Users\Rohit Pandey\AppData\Roaming\npm\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\sync\fs.js:18:20)
    at Object.safeCall [as safe] (C:\Users\Rohit Pandey\AppData\Roaming\npm\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\call.js:24:8)
    at DirectoryReader.readNextDirectory (C:\Users\Rohit Pandey\AppData\Roaming\npm\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\directory-reader.js:78:10)
    at Readable.DirectoryReader.stream._read (C:\Users\Rohit Pandey\AppData\Roaming\npm\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\Rohit Pandey\AppData\Roaming\npm\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\sync\index.js:27:21)
    at Function.readdirSyncStat (C:\Users\Rohit Pandey\AppData\Roaming\npm\node_modules\@loopback\cli\node_modules\@mrmlnc\readdir-enhanced\lib\index.js:34:10)
    at ReaderSync.dynamicApi (C:\Users\Rohit Pandey\AppData\Roaming\npm\node_modules\@loopback\cli\node_modules\yeoman-generator\node_modules\fast-glob\out\providers\reader-sync.js:64:24)
    at ReaderSync.api (C:\Users\Rohit Pandey\AppData\Roaming\npm\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: 'C:\\Users\\Rohit Pandey\\rohit-pandey\\_.gitignore'
}
like image 526
Rohit Pandey Avatar asked Oct 23 '25 09:10

Rohit Pandey


2 Answers

This is an issue that we are actively tracking: gitignore error while creating loopbackjs app

A workaround is to downgrade to an LTS release of Node.js (At this time of writing, v14 and v16).

As a best practice, we recommend sticking to LTS releases of Node.js to ensure stability as there have been breaking changes that occurred within Current releases, and to provide the maintainers time to investigate.

like image 183
Rifa Achrinza Avatar answered Oct 26 '25 00:10

Rifa Achrinza


Problem was with node version. I had downloaded most recent Node 17 which had backward compatibility issue.SO i downloaded LTS version of Nodejs. It's working fine now.

like image 35
Rohit Pandey Avatar answered Oct 25 '25 23:10

Rohit Pandey