I tried to update using npx storybook@latest upgrade but it failed with the following
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'jsonfile/utils'
Require stack:
- my-project\node_modules\@storybook\core-server\node_modules\fs-extra\lib\json\output-json.js
- my-project\node_modules\@storybook\core-server\node_modules\fs-extra\lib\json\index.js
- my-project\node_modules\@storybook\core-server\node_modules\fs-extra\lib\index.js
- my-project\node_modules\@storybook\core-server\dist\index.js
- my-project\node_modules\@storybook\cli\dist\generate.js
- my-project\node_modules\@storybook\cli\bin\index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (my-project\node_modules\@storybook\core-server\node_modules\fs-extra\lib\json\output-json.js:3:23)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'my-project\\node_modules\\@storybook\\core-server\\node_modules\\fs-extra\\lib\\json\\output-json.js',
'my-project\\node_modules\\@storybook\\core-server\\node_modules\\fs-extra\\lib\\json\\index.js',
'my-project\\node_modules\\@storybook\\core-server\\node_modules\\fs-extra\\lib\\index.js',
'my-project\\node_modules\\@storybook\\core-server\\dist\\index.js',
'my-project\\node_modules\\@storybook\\cli\\dist\\generate.js',
'my-project\\node_modules\\@storybook\\cli\\bin\\index.js'
]
}
To Reproduce
Run npx storybook@latest upgrade on a project that doesn't already include jsonfile. Looking at the Angular project on storybook.new, the package-json.lock already includes jsonfile due to multiple dependencies including it as a dependency, e.g. node_modules/@compodoc/ngd-transformer/node_modules/fs-extra so I'm not sure if I can reproduce it there.
Describe the bug
I tried to update using
npx storybook@latest upgrade
but it failed with the followingTo Reproduce
Run
npx storybook@latest upgrade
on a project that doesn't already includejsonfile
. Looking at the Angular project on storybook.new, the package-json.lock already includesjsonfile
due to multiple dependencies including it as a dependency, e.g. node_modules/@compodoc/ngd-transformer/node_modules/fs-extra so I'm not sure if I can reproduce it there.System
Additional context
Running
npm install --save-dev jsonfile/utils
resolved the error. The above info was generated after I successfully updated from7.0.0-beta.34
.