Skip to content
Advertisement

Storybook does not start

I have created react app with and create-react-app (and not made any changes in the app ) and initialized storybook by running npx sb init but running yarn storybook gives the following error. I have also tried this with nextjs but storybook gives the same error.


    ERR! SyntaxError: Invalid regular expression: /%G++%/: Nothing to repeat
    ERR!     at new RegExp (<anonymous>)
    ERR!     at H:Workreact-storybooknode_modules@storybookcore-commondistcjsutilstemplate.js:20:24
    ERR!     at Array.reduce (<anonymous>)
    ERR!     at interpolate (H:Workreact-storybooknode_modules@storybookcore-commondistcjsutilstemplate.js:19:31)
    ERR!     at getManagerHeadTemplate (H:Workreact-storybooknode_modules@storybookcore-commondistcjsutilstemplate.js:63:10)
    ERR!     at _default (H:Workreact-storybooknode_modules@storybookcore-serverdistcjsmanagermanager-webpack.config.js:61:99)
    ERR!     at async Object.start (H:Workreact-storybooknode_modules@storybookcore-serverdistcjsmanagerbuilder.js:94:16)
    ERR!     at async Promise.all (index 1)
    ERR!     at async storybookDevServer (H:Workreact-storybooknode_modules@storybookcore-serverdistcjsdev-server.js:103:28)
    ERR!     at async buildDevStandalone (H:Workreact-storybooknode_modules@storybookcore-serverdistcjsbuild-dev.js:107:31)
    ERR!     at async buildDev (H:Workreact-storybooknode_modules@storybookcore-serverdistcjsbuild-dev.js:147:5)
    ERR!  SyntaxError: Invalid regular expression: /%G++%/: Nothing to repeat
    ERR!     at new RegExp (<anonymous>)
    ERR!     at H:Workreact-storybooknode_modules@storybookcore-commondistcjsutilstemplate.js:20:24
    ERR!     at Array.reduce (<anonymous>)
    ERR!     at interpolate (H:Workreact-storybooknode_modules@storybookcore-commondistcjsutilstemplate.js:19:31)
    ERR!     at getManagerHeadTemplate (H:Workreact-storybooknode_modules@storybookcore-commondistcjsutilstemplate.js:63:10)
    ERR!     at _default (H:Workreact-storybooknode_modules@storybookcore-serverdistcjsmanagermanager-webpack.config.js:61:99)
    ERR!     at async Object.start (H:Workreact-storybooknode_modules@storybookcore-serverdistcjsmanagerbuilder.js:94:16)
    ERR!     at async Promise.all (index 1)
    ERR!     at async storybookDevServer (H:Workreact-storybooknode_modules@storybookcore-serverdistcjsdev-server.js:103:28)
    ERR!     at async buildDevStandalone (H:Workreact-storybooknode_modules@storybookcore-serverdistcjsbuild-dev.js:107:31)
    ERR!     at async buildDev (H:Workreact-storybooknode_modules@storybookcore-serverdistcjsbuild-dev.js:147:5)
    
    WARN Broken build, fix the error above.
    WARN You may need to refresh the browser.
    
    error Command failed with exit code 1.

Running npx sb info give the following info.

    Environment Info:

  System:
    OS: Windows 10 10.0.19041
    CPU: (4) x64 Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz   
  Binaries:
    Node: 14.15.4 - C:Program Filesnodejsnode.EXE       
    Yarn: 1.22.10 - ~AppDataRoamingnpmyarn.CMD
    npm: 7.17.0 - C:Program Filesnodejsnpm.CMD
  Browsers:
    Chrome: 91.0.4472.77
    Edge: Spartan (44.19041.1023.0), Chromium (91.0.864.48)
  npmPackages:
    @storybook/addon-actions: ^6.2.9 => 6.2.9 
    @storybook/addon-essentials: ^6.2.9 => 6.2.9 
    @storybook/addon-links: ^6.2.9 => 6.2.9 
    @storybook/react: ^6.2.9 => 6.2.9

Advertisement

Answer

It seems that my Windows environment variables were messed up, after a fresh Windows installation everything seems to be working fine.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement