Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

permissions issue #1

Closed
kylerits opened this issue May 5, 2021 · 4 comments
Closed

permissions issue #1

kylerits opened this issue May 5, 2021 · 4 comments
Labels
question Further information is requested

Comments

@kylerits
Copy link

kylerits commented May 5, 2021

Question

I'm not sure if this is more appropriate to address here or on the Vite repo, but I am having an issue with permissions when running the build script. I am not able to build out any folders during build be it 'dist' or any other that I've tested. I am getting an EACCES: permission denied, mkdir '/web' error. Have you run into this before? Is the issue more with Vite or Rollup or my environment?

Additional context

Add any other context or screenshots about the support request here.

I am running the site locally using Laravel valet. I have created a new branch of my starter template that had previously functioned using Webpack and Mix. Running through your blog post I ran into the previously mentioned road block.

Full error:


yarn build                                                                                                                                                                                                           
yarn run v1.22.5
$ vite build
vite v2.2.4 building for production...
transforming (1) vite/dynamic-import-polyfill
warn - You have enabled the JIT engine which is currently in preview.
warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.
✓ 3 modules transformed.
EACCES: permission denied, mkdir '/web'
error during build:
Error: EACCES: permission denied, mkdir '/web'
    at Object.mkdirSync (node:fs:1023:3)
    at mkdirpath (/craft3-starter/node_modules/rollup/dist/shared/rollup.js:17987:27)
    at mkdirpath (/craft3-starter/node_modules/rollup/dist/shared/rollup.js:17985:9)
    at mkdirpath (/craft3-starter/node_modules/rollup/dist/shared/rollup.js:17985:9)
    at /craft3-starter/node_modules/rollup/dist/shared/rollup.js:17998:9
    at new Promise (<anonymous>)
    at writeFile (/craft3-starter/node_modules/rollup/dist/shared/rollup.js:17997:12)
    at writeOutputFile (/craft3-starter/node_modules/rollup/dist/shared/rollup.js:20449:25)
    at /craft3-starter/node_modules/rollup/dist/shared/rollup.js:20371:65
    at Array.map (<anonymous>)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@kylerits kylerits added the question Further information is requested label May 5, 2021
@khalwat
Copy link
Contributor

khalwat commented May 5, 2021

So this isn't really an issue with the Vite plugin, this is going to be a permissions issue with whatever your local dev environment is imo.

Post your config please?

And also information about your local dev environment.

@Tim-Wils
Copy link

Tim-Wils commented May 6, 2021

This problem is easy to solve prefixeing the path with a . like so: './web' or './public_html'

@khalwat
Copy link
Contributor

khalwat commented May 6, 2021

Ah, I must have missed that then cleaning up the paths, thanks @Tim-Wils -- I updated the article.

@kylerits change it to:

    outDir: './web/dist/',

(or whatever the relative path to your public web dir is) in your vite.config.js file

@khalwat khalwat closed this as completed May 6, 2021
@kylerits
Copy link
Author

kylerits commented May 6, 2021

Beautiful. That did it. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants