#Problem with using "copy" library - to copy files

8 messages · Page 1 of 1 (latest)

urban kestrel
#

how it works? why is "1" folder created in folder "2"?
I just wanted to copy index html and paste it in 2
I'm using copy library (edited)

sage badge
urban kestrel
lyric depot
#

then use the operating systems built-in method. using a library is a mistake.

urban kestrel
#

I've used an library for it instead of command for X-platform

sage badge
urban kestrel
# sage badge Make your script accept command line arguments? <https://nodejs.org/api/process....

I made copyHtml.js: ```js
import fs from 'fs/promises';

await fs.copyFile('src/public/index.html', 'dist/public');


but it does some error even if I use admin: ```
node:internal/fs/promises:612
  return await PromisePrototypeThen(
         ^

Error: EPERM: operation not permitted, copyfile 'C:\Users\Skeku\Desktop\Raidcord\raidcord\src\public\index.html' -> 'C:\Users\Skeku\Desktop\Raidcord\raidcord\dist\public'
    at async Object.copyFile (node:internal/fs/promises:612:10)
    at async file:///C:/Users/Skeku/Desktop/Raidcord/raidcord/compilation/copyHtml.js:3:1 {
  errno: -4048,
  code: 'EPERM',
  syscall: 'copyfile',
  path: 'C:\\Users\\Skeku\\Desktop\\Raidcord\\raidcord\\src\\public\\index.html',
  dest: 'C:\\Users\\Skeku\\Desktop\\Raidcord\\raidcord\\dist\\public'
}

Node.js v21.2.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```
lyric depot
#

Give full destination path (including filename)