0

Hello!

When i run command bin/magento setup:static-content:deploy i give errors:

And my error: useful.css):

failed to open stream: No such file or directory

How to fix it? Thanks)

5
  • try to do with this command - sudo php bin/magento setup:static-content:deploy Commented Sep 23, 2019 at 13:31
  • Please try this: bin/magento setup:static-content:deploy -f Commented Sep 23, 2019 at 13:35
  • All this does not work Commented Sep 23, 2019 at 13:46
  • Have you checked the version compatibility with your PHP and other modules? Commented Sep 23, 2019 at 14:17
  • Yes, and also I updated all the modules that needed this Commented Sep 23, 2019 at 14:27

3 Answers 3

0

You need to change permissions or ownership of the project directory

To see who is currently logged user, run Linux command:

$whoami

To change the owner use the chown command:

$sudo chown -R username:username /magento-project-root

now run command for permission

$sudo chmod -R 755 /magento-project-root
cd magento-project-root
sudo chmod -R 777 var/ pub/ generated/
php bin/magento setup:static-content:deploy -f

if still not working then check error at var/log directory

answered Sep 23, 2019 at 14:04
4
  • I did it and it didn’t help Commented Sep 23, 2019 at 14:29
  • What is error on var/log ? Commented Sep 23, 2019 at 14:33
  • run command ls -l at root directory and check what is permissions for 'var, pub and generated' directory ? Commented Sep 23, 2019 at 14:38
  • I checked that I have the correct permissions for these directories: 777 Commented Sep 23, 2019 at 14:55
0

Try below steps:-

sudo rm -rf var/*
sudo rm -rf pub/static/frontend/*
sudo rm -rf generated/*
sudo chmod -R 777 /var/www/html/(project name)/
sudo php bin/magento setup:upgrade
sudo php bin/magento setup:static-content:deploy -f
sudo php bin/magento ca:cl
sudo php bin/magento ca:fl
sudo chmod -R 777 /var/www/html/(project name)/

Hope it's works for you

answered Sep 23, 2019 at 18:00
0

Try to delete the folder ~ "var/www/project/design/frontend/Alias/mytheme/web/css/source", and run the command php bin/magento setup:static-content:deploy -f If everything goes well the problem is in the styles

answered Sep 24, 2019 at 4:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.