react-three-next icon indicating copy to clipboard operation
react-three-next copied to clipboard

Problem when installing - "next not found"

Open Xoffio opened this issue 4 years ago • 8 comments
trafficstars

Hi,

I'm trying to install react-three-next When installation. I'm following the steps:

$ npx create-r3f-app next my-app
$ cd my-app
$ npm run dev

And it returns the next:

> [email protected] dev > next dev

sh: 1: next: not found

So inside of my-app I did:

> npm install

and it returns:

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! react@"^18.0.0-alpha-dbe3363cc" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@">=17.0" from @react-three/[email protected] npm ERR! node_modules/@react-three/fiber npm ERR! @react-three/fiber@"^7.0.6" from the root project npm ERR! peer @react-three/fiber@">=6.0" from @react-three/[email protected] npm ERR! node_modules/@react-three/a11y npm ERR! @react-three/a11y@"^2.1.0" from the root project 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 /home/spacecomet/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! /home/spacecomet/.npm/_logs/2021-09-01T20_21_29_342Z-debug.log

Any ideas why this happens. I'm not able to use this package...

Xoffio avatar Sep 01 '21 20:09 Xoffio

Related to https://github.com/pmndrs/react-three-next/issues/51 I'm really confused, I mean [email protected] doesn't even exist that's weird. I can't reproduce the issue with npx so I have no idea of how to fix it sorry. I can only recommend using yarn.

Are you on Linux?

RenaudRohlinger avatar Sep 04 '21 08:09 RenaudRohlinger

Yes, Linux scvb 5.11.0-27-generic #29~20.04.1-Ubuntu x86_64 x86_64 x86_64 GNU/Linux

Xoffio avatar Sep 04 '21 22:09 Xoffio

Running into this issue as well.

Mognoid3r avatar Sep 08 '21 22:09 Mognoid3r

Was able to npm i with the addition of --legacy-peer-deps

Mognoid3r avatar Sep 08 '21 22:09 Mognoid3r

Yeah... It is the same with react-spring (made by the same people I believe). I'm working in a project were I had to install everything with yarn instead of npm

It might be something related to how the set up the npm packages... If I know how to fix this I would contribute but I don't. I guess if someone knows how to package with npm they might fix this issue

Xoffio avatar Sep 09 '21 23:09 Xoffio

NPM v7+ will fail when there's conflicting peer dependencies (see release notes).

CodyJasonBennett avatar Sep 10 '21 04:09 CodyJasonBennett

@CodyJasonBennett so in order to fix this we have to update the dependencies? @RenaudRohlinger can we do that?

Xoffio avatar Sep 14 '21 13:09 Xoffio

Hi everybody,

I solved the problem by removing the eslint:'8' from devdependencies and I also removed eslint from dependencies. Because in Nextjs version 12 eslint is mixed in some way.

with : npm run dev its working without any error now!

Here is my packages.json file:

{ "name": "react-three-next", "version": "2.0.0", "authors": [ "Renaud ROHLINGER https://twitter.com/onirenaud" ], "license": "MIT", "private": true, "engines": { "node": ">=14" }, "scripts": { "lint": "yarn prettier && yarn eslint", "eslint": "next lint --fix --dir src", "prettier": "prettier -l "./src/**/*.{js,jsx,md}"", "dev": "next dev", "build": "next build", "export": "EXPORT=true next build && EXPORT=true next export", "analyze": "ANALYZE=true next build", "start": "next start" }, "dependencies": { "@babel/plugin-transform-runtime": "^7.17.0", "@react-three/drei": "^9.11.2", "@react-three/fiber": "^8.0.19", "babel-plugin-glsl": "^1.0.0", "glsl-random": "^0.0.5", "next": "^12.1.6", "react": "^18.1.0", "react-dom": "^18.1.0", "three": "^0.140.2", "three-stdlib": "^2.10.1", "zustand": "^4.0.0-rc.1" }, "devDependencies": { "@next/bundle-analyzer": "^12.0.10", "autoprefixer": "^10.4.2", "eslint-config-next": "^12.0.10", "eslint-config-prettier": "^8.3.0", "eslint-plugin-tailwind": "^0.2.1", "file-loader": "^6.2.0", "glslify": "^7.1.1", "glslify-loader": "^2.0.0", "next-compose-plugins": "^2.2.1", "next-offline": "^5.0.5", "postcss": "^8.4.12", "prettier": "^2.6.2", "raw-loader": "^4.0.2", "tailwindcss": "^3.0.23", "typescript": "^4.7.3", "url-loader": "^4.1.1" } }

S-hissam avatar Jun 11 '22 07:06 S-hissam

Any updates on this? Is there a way to use it along with ESLint? Did perhaps Next 13 fix something? Still experiencing this issue when using npm to install react-three-next.

xn1cklas avatar Feb 24 '23 13:02 xn1cklas