Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

yarnではなくnpmを使うように変更する #87

Closed
keitakn opened this issue Jun 4, 2021 · 1 comment
Closed

yarnではなくnpmを使うように変更する #87

keitakn opened this issue Jun 4, 2021 · 1 comment
Assignees

Comments

@keitakn
Copy link
Member

keitakn commented Jun 4, 2021

Doneの定義

  • package管理がyarnからnpmに変更されている事

補足情報

世界的にもyarn v2への移行は進んでいるとは言い難い。

GitHub Actionsもv2での実行例はあまりないので今後はnpmを使っていったほうが無難かもしれない。

@keitakn
Copy link
Member Author

keitakn commented Jun 19, 2021

以下のエラーが発生した。

npmの最新メジャーバージョンである7系だとバージョンを厳密にチェックするようになった為だと思われる。

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!   peerOptional react@"^16.8.0 || ^17.0.0" from @storybook/addon-a11y@6.2.9
npm ERR!   node_modules/@storybook/addon-a11y
npm ERR!     dev @storybook/addon-a11y@"^6.2.9" from the root project
npm ERR!   26 more (@storybook/addon-actions, @storybook/addon-docs, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4
npm ERR! node_modules/@storybook/api/node_modules/@reach/router
npm ERR!   @reach/router@"^1.3.4" from @storybook/api@6.2.9
npm ERR!   node_modules/@storybook/api
npm ERR!     @storybook/api@"6.2.9" from @storybook/addon-a11y@6.2.9
npm ERR!     node_modules/@storybook/addon-a11y
npm ERR!       dev @storybook/addon-a11y@"^6.2.9" from the root project
npm ERR!     5 more (@storybook/addon-actions, @storybook/addon-docs, ...)
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/kogakeita/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kogakeita/.npm/_logs/2021-06-19T03_39_55_880Z-debug.log
zsh: exit 1     npm install

一旦 npm install --legacy-peer-deps で対応する。

storybookjs/storybook#14065 (comment) でも言われているように、依存ライブラリが正式にReact17に対応するまでは、--legacy-peer-deps を使うしかなさそう。

@keitakn keitakn closed this as completed Jun 20, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant