I am using magento 2.0.2. while compiling i got the error as attached screenshot. Please help me to fix it.
1 Answer
First, do NOT edit the core files (vendor/magento).
For permissions, Magento 2 is a pain. I usually use the following:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
Also you can change the ownership to the user you are logged in:
chown -R $USER:$USER .
Make sure that user is in the apache group so it works properly.
For the error itself, try to move any extension you have outside the web folder, and run setup:upgrade each time you do that, and re-compile.
If nothing works, update to 2.0.11. That is the latest stable version of Magento 2. And to be honest 2.0.2 is not that stable.