Magento2: Grunt Task: "Fatal error: Class 'Locale' not found" Error

Created on 10 Nov 2015  ·  10Comments  ·  Source: magento/magento2

Hey there, I was hoping for some words of wisdom here. When executing the task grunt exec:luma I get an error as such "Fatal error: Class 'Locale' not found in ...frontend/magento2/data/magento2/lib/internal/Magento/Framework/Locale/Bundle/DataBundle.php on line 64".

Any ideas on why I would get this error? Is there a system dependency missing?

Also to note: I am currently on the latest version develop.

Format is not valid needs update

Most helpful comment

Possibly, when you ran the command Magento was not installed (composer, app, etc..).
Also intl extension is required for Magento 2.

All 10 comments

Possibly, when you ran the command Magento was not installed (composer, app, etc..).
Also intl extension is required for Magento 2.

Hey @Dell- Magento is definitely installed and running. As for the intl extension dependency, are we saying the the php and this extension is to be installed on my mac to run grunt from the project's environment. I am currently using mage2_vagrant as my vm.

I guess my question is that do I have to run nodejs/grunt from my vagrant box?

@angellromero,
Yes grunt exec task should be run on the environment with installed magento, as it relies on 'php bin/magento dev:source-theme:deploy PHP CLI command, collecting .less sources based on magento application config. So you need to run it from the vagrant machine.

Hello,
Is there any solution for the above issues. I am facing the same issues.
My current environment is :

  1. OS - Windows 8.1 and Mac-mini
  2. WebServer - MAMP 3 for windows and MAMP 3 for Mac
  3. Nodejs version 5.5.0
  4. Npm version 3.3.12
  5. Installed grunt component:
    ├── [email protected]
    ├── [email protected]
    └── [email protected]
  6. Magento CE - 2.0.0 and 2.0.1

Thanks in advance.

Hi,
I have the same issues in Mac OS when I run "grunt exec"
Fatal error: Class 'Locale' not found in /Applications/AMPPS/www/magento2/vendor/magento/framework/Locale/Bundle/DataBundle.php on line 64

Exited with code: 255.
I used AMPPS and I installed in intl extension.
And when I run "php bin/magento setup:static-content:deploy" to create static file.

  • run ''grunt watch"
  • I go to app/design/frontend/Magento/mytheme and change less file.
    -> command line "grunt watch" don't work.
  • I go to pub/static change file
    -> "grunt watch" worked.

Who have help me? Please.
Thanks

Hi,

Kindly install nodejs version older than 4.2.5.
Set environment variable PATH of php.exe.
Copy your php.ini from conf folder to bin/php7.0.0 folder
than run static content deploy command/
It should work.

Thanks

Can anyone confirm that raised problem is related to environment and solved already?

hi,
I Set environment variable PATH of php.exe.
and It worked now.
Thanks geetanshrsoni,

Hi Guys, How to solve this on amazon linux os ?

I have intl extension already !

intl extension is required for Magento 2.

i installed intl extension and everything was fine

  • run terminal as root
    -type apt-get install php7.3-intl
    -make sure the intl is base on ur php version, mine is php7.3 so i used that
Was this page helpful?
0 / 5 - 0 ratings