'Storybook throws an error when I want to install it with Next

Storybook throws this error when I am trying to install with a Next.js app which already exists:

Storybook error

 • Detecting project type. ✓
 • Adding Storybook support to your "React" app
     Unable to find versions of @storybook/react using npm

     Unable to find versions of @storybook/addon-links using npm

     Unable to find versions of @storybook/addon-essentials using npm

     Unable to find versions of @storybook/addon-actions using npm

     Unable to find versions of @storybook/addon-interactions using npm

The application is created in Next.js and Tailwind. the operating system I use is: Ubuntu 20.04.4 LTS, "next": "^12.0.4", "react": "^17.0.2", Node version : v16.15.0

I have tried this command:

npx sb init
npx sb init --builder webpack5


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source