Rohit Pandey
Rohit Pandey

Reputation: 51

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'
}

Upvotes: 4

Views: 667

Answers (4)

Ivan
Ivan

Reputation: 785

Downgrading node from version v17.2.0 to v16.13.1 helped me fix the issue.

Upvotes: 0

Rifa Achrinza
Rifa Achrinza

Reputation: 1585

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.

Upvotes: 4

Rohit Pandey
Rohit Pandey

Reputation: 51

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.

Upvotes: 1

GoldenretriverYT
GoldenretriverYT

Reputation: 4765

Seems like the .gitignore file inside the C:\Users\Rohit Pandey\rohit-pandey\ does not exist. Create it and the problem should be gone.

Upvotes: -1

Related Questions