question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: EACCES: permission denied (MacOS only)

See original GitHub issue

Describe 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.

photo_2019-07-28_21-30-03

This issue does not exist in Windows 10 although we did not check it in Linux.

To Reproduce Steps to reproduce the behavior:

  1. Clone my repository
  2. Use npm install
  3. 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:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Fflorielcommented, Sep 24, 2020

Took a bit of time but I think I found the issue.

            content: [
              path.resolve(srcDir, '/**/*.html')
            ],

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:

content: [
    `${srcDir}/**/*.html`
]
1reaction
Fflorielcommented, Sep 26, 2020

@HamedFathi

I tried your repository on my macbook, with the modification and the issue is solved

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found