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•15mo ago
you can't make new projects in the Windows folder, it's protected you'll have to change to a different folder
CDL
CDL•15mo 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•15mo ago
hm, my vite knowledge is quickly getting depleted... try without the restaurant-app bit? it should prompt you
CDL
CDL•15mo 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•15mo ago
and even without restaurant-app it complains about not having write access to c:\windows?
CDL
CDL•15mo ago
aye google hasn't been very helpful with the answer either, apart from creating a temporary mapping to start it
Jochem
Jochem•15mo ago
npm cache clean --force?
CDL
CDL•15mo 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•15mo ago
sounds about right
CDL
CDL•15mo 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•15mo 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
CDL•15mo ago
I'm running WSL it works fine in powershell
Jochem
Jochem•15mo ago
hm, I haven't used WSL in a while, so it's broken because that's what WSL does
CDL
CDL•15mo ago
WSL breaks things? lol
Jochem
Jochem•15mo 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
CDL•15mo ago
how fun lol
Jochem
Jochem•15mo ago
what does npm -v print?
CDL
CDL•15mo ago
umm.. I'm not sure what happened here but
No description
Jochem
Jochem•15mo 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
CDL•15mo 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•15mo ago
always glad to help(?) 😄 good luck with your app!
Want results from more Discord servers?
Add your server