Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

The mv() function tries to move files from the project directory #88

Closed
ghost opened this issue Aug 3, 2023 · 1 comment
Closed

The mv() function tries to move files from the project directory #88

ghost opened this issue Aug 3, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 3, 2023

The mv() function tries to move files from the project directory, not the templates directory. When trying to generate a module, it gives an error because there is no file named editorconfig in the project directory:

$ yo nm
? What do you want to name your module? unicorn
? What is your module description? My phenomenal module with unicorns!
? What is your GitHub username? haiksgithub
? What is the URL of your website? https://github.com/haiksgithub/
? Do you need a CLI? No
? Do you need code coverage? No
node:events:492
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, scandir '/home/haik/projects/unicorn/editorconfig'
    at Object.readdirSync (node:fs:1543:3)
    at exports.readdir (/home/haik/.local/share/nvm/versions/node/v20.5.0/lib/node_modules/generator-nm/node_modules/@mrmlnc/readdir-enhanced/lib/sync/fs.js:18:20)
    at Object.safeCall [as safe] (/home/haik/.local/share/nvm/versions/node/v20.5.0/lib/node_modules/generator-nm/node_modules/@mrmlnc/readdir-enhanced/lib/call.js:24:8)
    at DirectoryReader.readNextDirectory (/home/haik/.local/share/nvm/versions/node/v20.5.0/lib/node_modules/generator-nm/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:78:10)
    at DirectoryReader.stream._read (/home/haik/.local/share/nvm/versions/node/v20.5.0/lib/node_modules/generator-nm/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:57:18)
    at Readable.read (node:internal/streams/readable:515:12)
    at readdirSync (/home/haik/.local/share/nvm/versions/node/v20.5.0/lib/node_modules/generator-nm/node_modules/@mrmlnc/readdir-enhanced/lib/sync/index.js:27:21)
    at Function.readdirSyncStat (/home/haik/.local/share/nvm/versions/node/v20.5.0/lib/node_modules/generator-nm/node_modules/@mrmlnc/readdir-enhanced/lib/index.js:34:10)
    at ReaderSync.dynamicApi (/home/haik/.local/share/nvm/versions/node/v20.5.0/lib/node_modules/generator-nm/node_modules/fast-glob/out/providers/reader-sync.js:64:24)
    at ReaderSync.api (/home/haik/.local/share/nvm/versions/node/v20.5.0/lib/node_modules/generator-nm/node_modules/fast-glob/out/providers/reader-sync.js:56:25)
Emitted 'error' event on Readable instance at:
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/home/haik/projects/unicorn/editorconfig'
}

Node.js version: 20.5.0
Yeoman version: 4.3.1
generator-nm version: 7.0.0

@sindresorhus
Copy link
Owner

Closing as this repo is archived.

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant