Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

36
Views
MacOS Django less problem

I used Django to run Less on my Windows computer without any problems, but when I switched to MacOS, the system reported an error.

enter image description here

 StaticCompilationError at /friendLink
node:fs:1336
 handleErrorFromBinding(ctx);
 ^

Error: ENOENT: no such file or directory, mkdir '/static/styles/less/global'
 at Object.mkdirSync (node:fs:1336:3)
 at module.exports.sync (/Users/taro/.nvm/versions/node/v16.14.0/lib/node_modules/less/node_modules/make-dir/index.js:97:6)
 at ensureDirectory (/Users/taro/.nvm/versions/node/v16.14.0/lib/node_modules/less/bin/lessc:172:7)
 at writeOutput (/Users/taro/.nvm/versions/node/v16.14.0/lib/node_modules/less/bin/lessc:230:7)
 at /Users/taro/.nvm/versions/node/v16.14.0/lib/node_modules/less/bin/lessc:311:9 {
 errno: -2,
 syscall: 'mkdir',
 code: 'ENOENT',
 path: '/static/styles/less/global'
}

Passed:

 pip install django-static-precompiler
 npm install less -g

Django.py configuration:

 STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, '/static/')

STATICFILES_DIRS = (
 os.path.join(BASE_DIR, "static"),
)

STATIC_PRECOMPILER_OUTPUT_DIR = ''

Django Templates:

 {% load compile_static %}
{% load static %}
...
<link rel="stylesheet" href="{% static "styles/less/global/components.less"|compile %}"/>

I'm sure the Django project has this folder /static/styles/less/global

enter image description here

  1. I thought it was a permission issue.

 $ where lessc
/Users/taro/.nvm/versions/node/v16.14.0/bin/lessc

sudo chmod +x /Users/taro/.nvm/versions/node/v16.14.0/bin/lessc

But it's useless

  1. I've also tried PyCharm's File Watcher setup, but it shouldn't be a problem. When I write one less file and save it, CSS will still appear

Is it a problem with NVM, Django or Macos static precompiler configuration? I'm not sure

over 2 years ago · Carlos Garzón Colorado
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!