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

package.json is not generated ? #140

Closed
chrisnaadhi opened this issue Jul 3, 2024 · 6 comments
Closed

package.json is not generated ? #140

chrisnaadhi opened this issue Jul 3, 2024 · 6 comments

Comments

@chrisnaadhi
Copy link

hello, i'm trying to install in new fresh projects and got this instead
image
the package.json was not created then make the node said "Error: Cannot find module 'esbuild'"
image

is there any wrong things i've done ?
my environment :

Windows 11
Elixir 1.17.1 (compiled with Erlang/OTP 27)
Phoenix 1.17.14
Node v20.12.2
Npm 10.5.0

@chrisnaadhi
Copy link
Author

image
side-to-side the installation
left was on WSL Ubuntu
right was on Windows directly

the package.json was not generated on Windows

@chrisnaadhi
Copy link
Author

chrisnaadhi commented Jul 3, 2024

solved for now with copying the package.json from WSL manually
then npm install on the directory manually

the unsolved / unknown problem was package.json is still not generated automatically on windows version
and the install command is not executed

@EricAndresen
Copy link

EricAndresen commented Nov 19, 2024

Getting the same error on Linux (Debian) following the install instructions from the docs. It's a blocking issue for getting started.

@EricAndresen
Copy link

From what I've pieced together it looks like this script is run in the live_svelte.setup command, but fails due to a dependency conflict.

On mac I get the error below, but on Debian it fails silently (hence no package.json is created)

➜  livesvelte_test_app mix live_svelte.setup
-- Installing npm dependencies...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: esbuild@0.16.17
npm ERR! node_modules/esbuild
npm ERR!   dev esbuild@"^0.16.17" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer esbuild@">=0.17.0" from esbuild-svelte@0.9.0
npm ERR! node_modules/esbuild-svelte
npm ERR!   dev esbuild-svelte@"*" 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.

My theory is that esbuild is pinned to 0.16 in the setup script to prevent this issue (the watch command is removed in >0.17), but that now conflicts with the esbuild dependency @0.17 in the esbuild-svelte package, so new installs are borked.

@woutdp
Copy link
Owner

woutdp commented Nov 19, 2024

@EricAndresen
Thank you, that's correct. I've fixed this just now and released a new version 0.14.1. Let me know if things are working now. Also note, I'm planning on releasing version 0.15.0 pretty soon so keep an eye out for that one.

@EricAndresen
Copy link

Wow! That was so fast. I was poking around the setup script and saw it change in realtime. Thanks man! Really excited about the project.

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

No branches or pull requests

3 participants