# \[React/Next.js\] Trouble with peer dependencies on Slice Machine setup?

**URL:** <https://community.prismic.io/t/react-next-js-trouble-with-peer-dependencies-on-slice-machine-setup/4361>\
**Category:** Developing with Prismic\
**Tags:** slice-machine\
**Created:** [March 3, 2021, 5:46pm UTC](https://community.prismic.io/t/react-next-js-trouble-with-peer-dependencies-on-slice-machine-setup/4361 "2021-03-03T17:46:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [March 3, 2021, 5:46pm UTC](https://community.prismic.io/t/react-next-js-trouble-with-peer-dependencies-on-slice-machine-setup/4361/1 "2021-03-03T17:46:26Z")

</div>

Node 15 now comes with NPM 7. This last one is now treating peer dependencies as required, throwing errors instead of warnings. This has led to some issues with Slice Machine setup that we just fixed!

## next-slicezone

You should not experience the issue anymore when running `$ prismic sm --setup` with NPM 7. If you downgraded to NPM 6 (Node 14) in the meantime, you can get back to 7 again! Just make sure to update `next-slicezone` to `0.0.13` or higher~ 😌

## Storybook

You may also see some peer dependency issues when running npm install with `@storybook/react`, the solution to this is to have version `16.14.0` of react & react dom installed in your project.

```auto
"react": "16.14.0",
"react-dom": "16.14.0"

```

This is an open issue on Storybook and they are working on it.

> <https://github.com/storybookjs/storybook/issues/14119>
>
> NPM7 has changed the semantics of peer dependencies which caused NPM to fail: #1…2983
> 
> I updated the CLI to use \`--legacy-peer-deps\` to work around this issue: #14106
> 
> However, the underlying structure of the project has not changed, and presumably this will bite us in the future.
> 
> There are at least two kinds of dependency errors:
> \- \[x\] Dependencies on external libraries like \`@reach/router\` which are not React17 compatible
> \- \[\] Use of optional peer dependencies within Storybook itself, e.g. \`addon-docs\`
> 
> \## External libraries
> 
> For each library that is not NPM7 compatible, we should either
> \- Fork it, make it compatible, issue a PR, replace the fork with the upgrade once PR is merged
> \- OR upgrade to an alternative
> 
> In the case of \`@reach/router\`, the path forward could be \[React Router\](https://reacttraining.com/blog/reach-react-router-future/) which does \[support React 17\](https://github.com/ReactTraining/react-router/issues/7695)
> 
> \## Internal dependencies
> 
> \`@storybook/addon-docs\` has optional peer dependencies on each of the framework packages it supports \`@storybook/react\`, \`@storybook/vue\`, etc. It should be refactored to use dependency injection so that those dependencies can be removed. In addition, the react-specific code should probably be moved into \`@storybook/react\`, which is a bigger project.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [March 3, 2021, 5:46pm UTC](https://community.prismic.io/t/react-next-js-trouble-with-peer-dependencies-on-slice-machine-setup/4361/2 "2021-03-03T17:46:53Z")

</div>



---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [March 4, 2021, 10:26am UTC](https://community.prismic.io/t/react-next-js-trouble-with-peer-dependencies-on-slice-machine-setup/4361/3 "2021-03-04T10:26:15Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:55pm UTC](https://community.prismic.io/t/react-next-js-trouble-with-peer-dependencies-on-slice-machine-setup/4361/4 "2021-12-09T17:55:52Z")

</div>


