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)
-
try to do with this command - sudo php bin/magento setup:static-content:deployAnas Mansuri– Anas Mansuri2019年09月23日 13:31:58 +00:00Commented Sep 23, 2019 at 13:31
-
Please try this: bin/magento setup:static-content:deploy -fRavi Soni– Ravi Soni2019年09月23日 13:35:49 +00:00Commented Sep 23, 2019 at 13:35
-
All this does not workDavid Young– David Young2019年09月23日 13:46:01 +00:00Commented Sep 23, 2019 at 13:46
-
Have you checked the version compatibility with your PHP and other modules?MGento– MGento2019年09月23日 14:17:56 +00:00Commented Sep 23, 2019 at 14:17
-
Yes, and also I updated all the modules that needed thisDavid Young– David Young2019年09月23日 14:27:48 +00:00Commented Sep 23, 2019 at 14:27
3 Answers 3
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
-
I did it and it didn’t helpDavid Young– David Young2019年09月23日 14:29:38 +00:00Commented Sep 23, 2019 at 14:29
-
What is error on var/log ?Rajesh Hothi– Rajesh Hothi2019年09月23日 14:33:49 +00:00Commented Sep 23, 2019 at 14:33
-
run command ls -l at root directory and check what is permissions for 'var, pub and generated' directory ?Rajesh Hothi– Rajesh Hothi2019年09月23日 14:38:06 +00:00Commented Sep 23, 2019 at 14:38
-
I checked that I have the correct permissions for these directories: 777David Young– David Young2019年09月23日 14:55:02 +00:00Commented Sep 23, 2019 at 14:55
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
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
Explore related questions
See similar questions with these tags.