Error: EACCES: permission denied (MacOS only)
See original GitHub issueDescribe the bug
I made a PR for Aurelia CLI. This PR will add Tailwind CSS (with PurgeCSS) as a new option in CLI.
We encountered a problem in the process of completing it. Unfortunately, I have no access to any Mac system so I have to quote.
ERROR in ./src/tailwind.css
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: EACCES: permission denied, scandir '/Library/Application Support/Apple/AssetCache/Data'
at Object.readdirSync (fs.js:779:3)
at GlobSync._readdir (/Users/huocp/playground/hw/node_modules/glob/sync.js:288:41)
at GlobSync._readdirInGlobStar (/Users/huocp/playground/hw/node_modules/glob/sync.js:267:20)
at GlobSync._readdir (/Users/huocp/playground/hw/node_modules/glob/sync.js:276:17)
at GlobSync._processReaddir (/Users/huocp/playground/hw/node_modules/glob/sync.js:137:22)
at GlobSync._process (/Users/huocp/playground/hw/node_modules/glob/sync.js:132:10)
at GlobSync._processGlobStar (/Users/huocp/playground/hw/node_modules/glob/sync.js:380:10)
at GlobSync._process (/Users/huocp/playground/hw/node_modules/glob/sync.js:130:10)
at GlobSync._processGlobStar (/Users/huocp/playground/hw/node_modules/glob/sync.js:383:10)
at GlobSync._process (/Users/huocp/playground/hw/node_modules/glob/sync.js:130:10)
at GlobSync._processGlobStar (/Users/huocp/playground/hw/node_modules/glob/sync.js:383:10)
at GlobSync._process (/Users/huocp/playground/hw/node_modules/glob/sync.js:130:10)
at GlobSync._processGlobStar (/Users/huocp/playground/hw/node_modules/glob/sync.js:383:10)
at GlobSync._process (/Users/huocp/playground/hw/node_modules/glob/sync.js:130:10)
at GlobSync._processGlobStar (/Users/huocp/playground/hw/node_modules/glob/sync.js:383:10)
at GlobSync._process (/Users/huocp/playground/hw/node_modules/glob/sync.js:130:10)
@ ./src/app.html
@ ./src/app.js
@ ./src/main.js
@ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
@ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry aurelia-bootstrapper
Error: EPERM: operation not permitted, scandir '/Library/Application Support/com.apple.TCC'
We find out the problem is PurgeCSS, not TailwindCSS because when we disable PurgeCSS in configuration (production mode) everything works without error.
Please read this issue comment and the following posts for more information.
This issue does not exist in Windows 10 although we did not check it in Linux.
To Reproduce Steps to reproduce the behavior:
- Clone my repository
- Use
npm install
- Then use
au build --en prod
(production mode)
Now you can see errors.
Expected behavior Work without error on MacOS.
Desktop (please complete the following information):
- OS: MacOS
- Version of Purgecss latest
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
NPM Mac OS error: EACCES: permission denied, access '/usr ...
Just paste this below line in terminal this should work as-is. sudo chown -R $(whoami) /usr/local/lib/node_modules.
Read more >How to fix EACCES errors with NPM on MacOS - WILL & SKILL
Error : EACCES: permission denied, access '/usr/local/lib/node_modules/react-native-cli/node_modules/ansi-styles' npm ERR! { [Error: EACCES: permission ...
Read more >Permission denied in Mac Terminal? Try this fix - MacPaw
The 'Permission denied' error in Terminal is usually caused by permission problems with the file or directory that you want to work on....
Read more >How Do I Fix Permission Denied on Mac - EaseUS
1. Permission denied for files, folders, or disks on Mac - The most likely reason for permission denied error when you want to...
Read more >Resolving EACCES permissions errors when installing ...
Resolving EACCES permissions errors when installing packages globally · Reinstall npm with a node version manager (recommended),. or · Manually change npm's ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Took a bit of time but I think I found the issue.
If you
console.log()
the content, you will see it doesn’t take into consideration the srcDir and end up being/**/*.html
. Which means the glob will try to scan all the directories on your machine. And it will cause an access error.You can solve this by changing the content to:
@HamedFathi
I tried your repository on my macbook, with the modification and the issue is solved