Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

NPM Fails to Install dependencies #180

Closed
janmohn opened this issue Dec 17, 2023 · 3 comments · Fixed by #186
Closed

NPM Fails to Install dependencies #180

janmohn opened this issue Dec 17, 2023 · 3 comments · Fixed by #186

Comments

@janmohn
Copy link

janmohn commented Dec 17, 2023

Have you experienced this bug with the latest version of the template?

Yes

Steps to Reproduce

npx create-remix@latest --template remix-run/grunge-stack
Dependencies installing with npm...

▲  Oh no! Failed to install dependencies.

The above happened repeatedly in different directories


Whilst troubleshooting I installed a fresh remix@latest app, without the grunge template and the install including the dependencies completed without error.

Expected Behavior

complete install and config steps

Actual Behavior

install fails on npm dependency install

@finack
Copy link

finack commented Dec 19, 2023

Here is the NPM error.

❯ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @remix-run/dev@2.4.0
npm ERR! Found: vite@4.5.1
npm ERR! node_modules/vite
npm ERR!   dev vite@"^4.5.0" from the root project
npm ERR!   peer vite@"^4.2.0 || ^5.0.0" from @vitejs/plugin-react@4.2.1
npm ERR!   node_modules/@vitejs/plugin-react
npm ERR!     dev @vitejs/plugin-react@"^4.1.0" from the root project
npm ERR!   3 more (vitest, vite-tsconfig-paths, @vanilla-extract/integration)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional vite@"^5.0.0" from @remix-run/dev@2.4.0
npm ERR! node_modules/@remix-run/dev
npm ERR!   dev @remix-run/dev@"^2.4.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vite@5.0.10
npm ERR! node_modules/vite
npm ERR!   peerOptional vite@"^5.0.0" from @remix-run/dev@2.4.0
npm ERR!   node_modules/@remix-run/dev
npm ERR!     dev @remix-run/dev@"^2.4.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.

@finack
Copy link

finack commented Dec 19, 2023

I was able to get past this error by running npm install --force. The smoke test all ran and the app seems to be fine. Have not tried to deploy.

@beduncs
Copy link

beduncs commented Dec 25, 2023

It looks like the ^ carat range version constraint in package.json is causing issues. The major version of vite appears to be the discrepancy. I was able to resolve by changing "vite": "^4.5.0" to "vite": "^5.0.0". I would create a PR for that change, but I am brand new to JS and do not know much about these dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants