I’ve also posted on the Vitejs discussion board as I’m not sure if the source of the problem is the shopify app create node command or ViteJS, which is a dependency of the boilerplate Shopify Nodejs app.
Since yesterday I’m getting this error while running shopify app serve
node:fs:1195
┃ return handleErrorFromBinding(ctx);
┃ ^
┃
┃ Error: EACCES: permission denied, rmdir '/mnt/c/Projects/Shopify/frontend/node_modules/.vite/deps'
┃ at rmdirSync (node:fs:1195:10)
┃ at _rmdirSync (node:internal/fs/rimraf:235:5)
┃ at rimrafSync (node:internal/fs/rimraf:193:7)
┃ at rmSync (node:fs:1244:10)
┃ at removeDirSync (/mnt/c/Projects/Shopify/frontend/node_modules/vite/dist/node/chunks/dep-e1fc1d62.js:2566:9)
┃ at loadCachedDepOptimizationMetadata (/mnt/c/Projects/Shopify/frontend/node_modules/vite/dist/node/chunks/dep-e1fc1d62.js:39489:5)
┃ at createOptimizedDeps (/mnt/c/Projects/Shopify/frontend/node_modules/vite/dist/node/chunks/dep-e1fc1d62.js:59505:28)
┃ at initOptimizer (/mnt/c/Projects/Shopify/frontend/node_modules/vite/dist/node/chunks/dep-e1fc1d62.js:60072:37)
┃ at createServer (/mnt/c/Projects/Shopify/frontend/node_modules/vite/dist/node/chunks/dep-e1fc1d62.js:60096:9)
┃ at async createServer (file:///mnt/c/Projects/Shopify/frontend/server/index.js:115:12) {
┃ errno: -13,
┃ syscall: 'rmdir',
┃ code: 'EACCES',
┃ path: '/mnt/c/Projects/Shopify/frontend/node_modules/.vite/deps'
┃ }
It seems that it has something to do with write permissions to a hidden vite folder in node_modules. Before yesterday everything worked well. As far as I know I did not make any large changes, like updating npm packages or so. And it seems unlikely that I need to run the shopify app serve
command using sudo.
Things that I’ve tried:
I’ve tried to create a new Shopify Nodejs boilerplate app with shopify app create node
but also this app envokes the same error while serving.
I’ve also tried to rebuild packages by removing node_modules and initiated a npm install but then I get the error that there is no .git folder, so to fix this particular problem I’ve created a new boilerplate app and overwrite the existing node_modules folder by the new one. But then the original problem persists.
Anyone an idea what I’m overlooking?
I’m running
Windows 10 Pro
Windows Subsystem for Linux
Shopify v2.19.0
Vite v2.9.8
Thanks in advance!
Allan