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

[vite-react] NPM RUN BUILD ERROR: EACCES: permission denied, stat '/root/.node_modules/vite/preload-helper' #7080

Closed
7 tasks done
yourjhay opened this issue Feb 25, 2022 · 3 comments

Comments

@yourjhay
Copy link

Describe the bug

I encounter this bug when building for production using react,
i successfully build the project in my local environment. However when I tried to deploy the app in our testing server, npm run build is not working

Reproduction

npm run build working on local environment but not on test server

System Info

Test Server:  
System:
    OS: Linux 4.15 Ubuntu 18.04.3 LTS (Bionic Beaver)
    CPU: (8) x64 AMD EPYC Processor (with IBPB)
    Memory: 399.60 MB / 15.29 GB
    Container: Yes
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 14.16.0 - /usr/local/bin/node
    npm: 7.21.1 - /usr/local/bin/npm
  npmPackages:
    @vitejs/plugin-legacy: ^1.6.2 => 1.7.1 
    @vitejs/plugin-react: ^1.0.7 => 1.2.0 
    vite: ^2.8.0 => 2.8.4

Used Package Manager

npm

Logs

[vite:resolve] EACCES: permission denied, stat '/root/.node_modules/vite/preload-helper'
error during build:
Error: EACCES: permission denied, stat '/root/.node_modules/vite/preload-helper'
    at Object.statSync (fs.js:1086:3)
    at isDirectory (/var/www/vhosts/jjwc-hris.bentacos.com/dev.jjwc-hris.bentacos.com/jjwc-frontend/node_modules/resolve/lib/sync.js:31:23)
    at loadNodeModulesSync (/var/www/vhosts/jjwc-hris.bentacos.com/dev.jjwc-hris.bentacos.com/jjwc-frontend/node_modules/resolve/lib/sync.js:200:17)
    at Function.resolveSync [as sync] (/var/www/vhosts/jjwc-hris.bentacos.com/dev.jjwc-hris.bentacos.com/jjwc-frontend/node_modules/resolve/lib/sync.js:107:17)
    at resolveFrom (/var/www/vhosts/jjwc-hris.bentacos.com/dev.jjwc-hris.bentacos.com/jjwc-frontend/node_modules/vite/dist/node/chunks/dep-971d9e33.js:2077:29)
    at resolvePackageData (/var/www/vhosts/jjwc-hris.bentacos.com/dev.jjwc-hris.bentacos.com/jjwc-frontend/node_modules/vite/dist/node/chunks/dep-971d9e33.js:28938:19)
    at /var/www/vhosts/jjwc-hris.bentacos.com/dev.jjwc-hris.bentacos.com/jjwc-frontend/node_modules/vite/dist/node/chunks/dep-971d9e33.js:29319:15
    at Array.find (<anonymous>)
    at tryNodeResolve (/var/www/vhosts/jjwc-hris.bentacos.com/dev.jjwc-hris.bentacos.com/jjwc-frontend/node_modules/vite/dist/node/chunks/dep-971d9e33.js:29318:44)
    at Object.resolveId (/var/www/vhosts/jjwc-hris.bentacos.com/dev.jjwc-hris.bentacos.com/jjwc-frontend/node_modules/vite/dist/node/chunks/dep-971d9e33.js:29150:28)

Validations

@yourjhay
Copy link
Author

image

@bluwy
Copy link
Member

bluwy commented Feb 25, 2022

May be related to #6767

@sodatea
Copy link
Member

sodatea commented Apr 28, 2022

Should have been fixed by #7612, shipped in Vite 2.9.2.

@sodatea sodatea closed this as completed Apr 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants