@sveltejs/adapter-static: copyfile favicon.ico not permitted (npm run build)
See original GitHub issueDescribe the bug
I developed an app and it worked with npm run dev. If I try to build it with npm run build, I get the error:
EPERM: operation not permitted, copyfile 'C:\Users\Patrick\dev\internal\rust-jungle\static\favicon.ico' -> 'build\favicon.ico'
I also tried running a terminal with admin permissions, but it results in the same error.
Logs Please include browser console and server logs around the time this bug occurred.
To Reproduce Create a new SvelteKit project, use the adapter-static, replace the favicon and try a npm run build.
Expected behavior A clear and concise description of what you expected to happen. build succeeds without any errors.
Stacktraces
If you have a stack trace to include, we recommend putting inside a <details>
block for the sake of the thread’s readability:
EPERM: operation not permitted, copyfile 'C:\Users\Patrick\dev\internal\rust-jungle\static\favicon.ico' -> 'build\favicon.ico'
> Using @sveltejs/adapter-static
> EPERM: operation not permitted, copyfile 'C:\Users\Patrick\dev\internal\rust-jungle\static\favicon.ico' -> 'build\favicon.ico'
Error: EPERM: operation not permitted, copyfile 'C:\Users\Patrick\dev\internal\rust-jungle\static\favicon.ico' -> 'build\favicon.ico'
at Object.copyFileSync (node:fs:2797:3)
at copy (file:///C:/Users/Patrick/dev/internal/rust-jungle/node_modules/@sveltejs/kit/dist/chunks/utils.js:39:15)
at file:///C:/Users/Patrick/dev/internal/rust-jungle/node_modules/@sveltejs/kit/dist/chunks/utils.js:35:18
at Array.forEach (<anonymous>)
at copy (file:///C:/Users/Patrick/dev/internal/rust-jungle/node_modules/@sveltejs/kit/dist/chunks/utils.js:34:33)
at Object.copy_static_files (file:///C:/Users/Patrick/dev/internal/rust-jungle/node_modules/@sveltejs/kit/dist/chunks/index5.js:290:4)
at adapt (file:///C:/Users/Patrick/dev/internal/rust-jungle/node_modules/@sveltejs/adapter-static/index.js:14:10)
at adapt (file:///C:/Users/Patrick/dev/internal/rust-jungle/node_modules/@sveltejs/kit/dist/chunks/index5.js:322:8)
at file:///C:/Users/Patrick/dev/internal/rust-jungle/node_modules/@sveltejs/kit/dist/cli.js:616:11
Information about your SvelteKit Installation:
Diagnostics
System: OS: Windows 10 10.0.19043 CPU: (4) x64 Intel® Core™ i5-6500 CPU @ 3.20GHz Memory: 8.66 GB / 15.96 GB Binaries: Node: 16.1.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD npm: 7.5.2 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.19041.964.0), Chromium (90.0.818.62)
- Your adapter (e.g. Node, static, Vercel, Begin, etc…): @sveltejs/adapter-static
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top GitHub Comments
FYI I had the same issue because:
So, I deleted the build folder and then rebuild and now the issue is gone. I added a script anyway to always remove the build folder before a build.
Getting the same issue:
Seems that favicon.ico folder isn’t being populated with the default favicon.ico that exists at the root of the static folder. Instead, favicon.ico is placed at the project root (/). Which I would think would be preferred?