Issue starting a vanilla js build with vite

Using WSL terminal and I'm trying to start a project using vite, keep encountering the below error..
Error: EPERM: operation not permitted, mkdir 'C:\Windows\restaurant-app'
at Object.mkdirSync (node:fs:1395:3)
at Zr (file:///C:/Users/User/AppData/Local/npm-cache/_npx/1415fee72ff6294b/node_modules/create-vite/dist/index.mjs:48:7572)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -4048,
syscall: 'mkdir',
code: 'EPERM',
path: 'C:\\Windows\\restaurant-app'
Error: EPERM: operation not permitted, mkdir 'C:\Windows\restaurant-app'
at Object.mkdirSync (node:fs:1395:3)
at Zr (file:///C:/Users/User/AppData/Local/npm-cache/_npx/1415fee72ff6294b/node_modules/create-vite/dist/index.mjs:48:7572)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -4048,
syscall: 'mkdir',
code: 'EPERM',
path: 'C:\\Windows\\restaurant-app'
process I tried is below:
npm create vite@latest restaurant-app
npm create vite@latest restaurant-app
21 Replies
Jochem
Jochem•2y ago
you can't make new projects in the Windows folder, it's protected you'll have to change to a different folder
CDL
CDLOP•2y ago
I didn't even think I was in it tbh, I'm currently in
laing91@PCS-PC:~/code/restaurant-page$
laing91@PCS-PC:~/code/restaurant-page$
on wSL
Jochem
Jochem•2y ago
hm, my vite knowledge is quickly getting depleted... try without the restaurant-app bit? it should prompt you
CDL
CDLOP•2y ago
nah you get the option to choose project name, framework and ts/js It wants to run it from
'\\wsl.localhost\Ubuntu\home\laing91\code\restaurant-page'
'\\wsl.localhost\Ubuntu\home\laing91\code\restaurant-page'
Jochem
Jochem•2y ago
and even without restaurant-app it complains about not having write access to c:\windows?
CDL
CDLOP•2y ago
aye google hasn't been very helpful with the answer either, apart from creating a temporary mapping to start it
Jochem
Jochem•2y ago
npm cache clean --force?
CDL
CDLOP•2y ago
chatgpt gave me the reason it failed, which is right, then gave me the fix, which gave the same fail hahaha damnit
Jochem
Jochem•2y ago
sounds about right
CDL
CDLOP•2y ago
same issue again using your suggestion btw I could just do it all in powershell but if most of my projects going forward will be using tooling, I kinda need to fix this 😄
Jochem
Jochem•2y ago
I always hate saying this, but it works on my machine... Are you running powershell, or powershell (admin mode) oh, you're using wsl, wait
CDL
CDLOP•2y ago
I'm running WSL it works fine in powershell
Jochem
Jochem•2y ago
hm, I haven't used WSL in a while, so it's broken because that's what WSL does
CDL
CDLOP•2y ago
WSL breaks things? lol
Jochem
Jochem•2y ago
mine randomly decides to just not start sometimes, especially after I haven't used it for a few weeks. It works fine most of the time though
CDL
CDLOP•2y ago
how fun lol
Jochem
Jochem•2y ago
what does npm -v print?
CDL
CDLOP•2y ago
umm.. I'm not sure what happened here but
No description
Jochem
Jochem•2y ago
oh nice, it worked! I've long since given up wanting to know why something suddenly works. As long as it keeps working, that's all good
CDL
CDLOP•2y ago
hahaha yeah, I did a bunch of things but it could've been a terminal restart that did it after re-installing npm, node etc. thanks jochem 🙂
Jochem
Jochem•2y ago
always glad to help(?) 😄 good luck with your app!
Want results from more Discord servers?
Add your server