Home > Enterprise >  Gitlab build fails because of storybook
Gitlab build fails because of storybook

Time:12-29

I'm trying to add building of storybook in Gitlab CI. I have storybook of 6.5 version, webpack 5.6 version. Build for some reason fails. And I receive this error:

enter image description here

npm WARN ERESOLVE overriding peer dependency
89npm WARN While resolving: [email protected]
90npm WARN Found: [email protected]
91npm WARN node_modules/webpack
92npm WARN   dev webpack@"^5.60.0" from the root project
93npm WARN   34 more (@pmmmwh/react-refresh-webpack-plugin, ...)
94npm WARN 
95npm WARN Could not resolve dependency:
96npm WARN peer webpack@"^2.0.0 || ^3.0.0 || ^4.0.0" from [email protected]
97npm WARN node_modules/webpack-filter-warnings-plugin
98npm WARN   webpack-filter-warnings-plugin@"^1.2.1" from @storybook/[email protected]
99npm WARN   node_modules/@storybook/builder-webpack4
100npm WARN 
101npm WARN Conflicting peer dependency: [email protected]
102npm WARN node_modules/webpack
103npm WARN   peer webpack@"^2.0.0 || ^3.0.0 || ^4.0.0" from [email protected]
104npm WARN   node_modules/webpack-filter-warnings-plugin
105npm WARN     webpack-filter-warnings-plugin@"^1.2.1" from @storybook/[email protected]
106npm WARN     node_modules/@storybook/builder-webpack4
107npm notice 
108npm notice New major version of npm available! 8.19.2 -> 9.2.0
109npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.2.0>
110npm notice Run `npm install -g [email protected]` to update!
111npm notice 
112npm ERR! code EUSAGE
113npm ERR! 
114npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
115npm ERR! 
116npm ERR! Invalid: lock file's [email protected] does not satisfy [email protected]
117npm ERR! 
118npm ERR! Clean install a project
119npm ERR! 
120npm ERR! Usage:
121npm ERR! npm ci
122npm ERR! 
123npm ERR! Options:
124npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
125npm ERR! [-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
126npm ERR! [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
127npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
128npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
129npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
130npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]
131npm ERR! 
132npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
133npm ERR! 
134npm ERR! Run "npm help ci" for more info
135npm ERR! A complete log of this run can be found in:
136npm ERR!     /root/.npm/_logs/2022-12-22T06_59_38_181Z-debug-0.log

In package.json I have this dependencies:

"@storybook/addon-actions": "^6.5.13",
"@storybook/addon-essentials": "^6.5.13",
"@storybook/addon-interactions": "^6.5.13",
"@storybook/addon-links": "^6.5.13",
"@storybook/builder-webpack5": "^6.5.13",
"@storybook/manager-webpack5": "^6.5.13",
"@storybook/react": "^6.5.13",

I have tried to upgrade dependencies, tried to downgrade storybook, tried to install with legacy-peer-deps, it's still doesn't work.

nodejs is also updated to the latest version (18.12.1).

What can be wrong?

CodePudding user response:

The problem was in nodejs. Turns out, storybook 16th version doesn't work with nodejs 18th versions. So I updated nodejs image to 16.6.0 version and it worked.

  • Related