After installing magento 2 CE, I had
ReferenceError: require is not defined
in console. I found this solution
c:\xampp\php\php.exe -f d:\projects\localsites\magento2.local\magento\bin\magento -- setup:static-content:deploy
And that helps me, but every time when I flush my static cache, this problem happens again. How I can solve this problem "forever".
Switch to the developer mode, and the static content will be deployed automatically (no need for setup:static-content:deploy
).