0

I am having troubles on runnning a code online, it's the sliding image puzzle from this link: https://www.youtube.com/watch?v=_wdbhVvMOCs and here is the github from the video's description: https://github.com/danba340/react-sliding-puzzle

If I type in npm start, it shows this error on the local host.

After running it on the VS Code, it shows this error that says \node_modules\react-motion doesn't exist.

Whenever I try npm install --save react-motion , it shows this error on the Visual Studio Code.

Please help me this is for my project thank you!

Mimist0p
  • 1
  • 1

1 Answers1

0

The reason is because the library doesn’t support react 17 yet.

Try by reinstalling your modules from scratch with the following:

rm -rf node_modules package-lock.json; npm i; npm i react-motion

If that doesn’t work, you’ll need to force the installation:

npm i react-motion —-legacy-peer-deps

If the library still have problems, you’ll then need to downgrade react to version 16 instead of 17 to make it work.

Last but not least, if you don’t want to downgrade, you can try to do the same by using yarn instead of npm

ale917k
  • 1,494
  • 7
  • 18
  • 37