wewowweb/laravel-svelte-preset

dependency resolution failure

Closed this issue · 16 comments

ITwrx commented

The below is what happens when i run npm install && npm run dev.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: laravel-mix@6.0.13
npm ERR! node_modules/laravel-mix
npm ERR!   dev laravel-mix@"^6.0.6" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer laravel-mix@"^4.0.0" from laravel-mix-svelte@0.1.6
npm ERR! node_modules/laravel-mix-svelte
npm ERR!   dev laravel-mix-svelte@"^0.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! 

Thanks

This package is a bit behind the current version of laravel-mix-svelte which solves this issue with release 0.4.0

Change the version from laravel-mix-svelte@"^0.1.0" to laravel-mix-svelte@"^0.4.0" in your package.json and try to run the install script again.

(Also see this )

ITwrx commented

thanks @callon
the first part worked, but... well, here's the whole output:

npm install && npm run dev
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

added 1304 packages, and audited 1305 packages in 29s

95 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> dev
> npm run development


> development
> mix

 	Additional dependencies must be installed. This will only take a moment.
 
 	Running: npm install sass-loader@10.* sass resolve-url-loader@^3.1.2 --save-dev --legacy-peer-deps
 
 	Finished. Please run Mix again.
 
npm ERR! code 1
npm ERR! path /var/www/laravel-svelte-preset
npm ERR! command failed
npm ERR! command sh -c mix

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/itwrx/.npm/_logs/2021-03-06T22_37_23_497Z-debug.log
npm ERR! code 1
npm ERR! path /var/www/laravel-svelte-preset
npm ERR! command failed
npm ERR! command sh -c npm run development

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/itwrx/.npm/_logs/2021-03-06T22_37_23_530Z-debug.log

i'm not experienced with this mix/node stuff, as you might have guessed. :)

What's your Node / Npm version?

Can you share your package.json, as well as the output of the log file /home/itwrx/.npm/_logs/2021-03-06T22_37_23_530Z-debug.log?

ITwrx commented

nodejs.x86_64 1:14.15.4-1.fc33
npm.x86_64 1:6.14.10-1.14.15.4.1.fc33

package.json

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "axios": "^0.21",
        "laravel-mix": "^6.0.6",
        "laravel-mix-svelte": "^0.4.0",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "resolve-url-loader": "^3.1.2",
        "sass": "^1.32.8",
        "sass-loader": "^10.1.1",
        "svelte": "^3.1.0",
        "svelte-loader": "^2.13.4"
    }
}

log:

0 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'run', 'dev' ]
1 info using npm@7.6.1
2 info using node@v14.15.4
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 2ms
5 timing config:load:builtin Completed in 2ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/var/www/laravel-svelte-preset/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/home/itwrx/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/usr/etc/npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 8ms
19 verbose npm-session ebaebc56ab6665e5
20 timing npm:load Completed in 17ms
21 timing command:run Completed in 4930ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (events.js:315:20)
22 verbose stack     at maybeClose (internal/child_process.js:1048:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
23 verbose cwd /var/www/laravel-svelte-preset
24 verbose Linux 5.10.18-200.fc33.x86_64
25 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "run" "dev"
26 verbose node v14.15.4
27 verbose npm  v7.6.1
28 error code 1
29 error path /var/www/laravel-svelte-preset
30 error command failed
31 error command sh -c npm run development
32 verbose exit 1

thanks

Hey @ITwrx,

did you manage to solve the issue?

Also, thanks to @callon for troubleshooting, much appreciated.

Kind regards,
g

ITwrx commented

@morpheus7CS no, i would have updated this issue. thanks

@ITwrx This seems to be an issue with your Node version. I tried installing your Node version (14.15.10) which gave me another version of NPM than what you're using, but a similar error.

After upgrading to the latest stable version of Node (v15.11.0 (with npm 6.14.10)) I didn't encounter any errors (except a file not found, because of opiniated code from the preset that favors the older .scss scaffolding).

@morpheus7CS NP, I'm interested in the project, and this issue was straight up something I've been encountering a lot recently.

ITwrx commented

@callon thanks. i'll wait on an update.

@ITwrx sorry, I wasn't clear in my communication: can you try to update your Node version to the latest version and try again? That fixed the issue for me!

ITwrx commented

@callon sorry i wasn't clear in my reply. :) i'll wait on a node update from my distro. Or maybe i'll install a newer version via a more manual method, but we'll have to see about that.
thanks

@ITwrx okay that makes sense. I recommend using a node version manager, but I assume you're on Windows which I'm not familiar with for development.

Consider checking out https://github.com/coreybutler/nvm-windows if you want, it popped up in a quick search and seems decent.

ITwrx commented

but I assume you're on Windows which I'm not familiar with for development.

sacrilege! :) I'm using fedora 33. There was a hint in my node package names above but i could have mentioned it.

Haha, sorry for assuming the worst ;) Doesn't 'n' work for fedora?

ITwrx commented

i either hadn't hear of n or had forgot. thanks for the info. installed n and installed node 15.11.0. then ran npm install && npm run dev which compiled, but had the following error:

✖ Mix
  Compiled with some errors in 1.65s

ERROR in /js/app
Module not found: Error: Can't resolve '/var/www/laravel-svelte-preset/resources/sass/app.scss' in '/var/www/laravel-svelte-preset'

webpack compiled with 1 error

Is that anything to even worry about?

@ITwrx nope, not at all! That's just because the listed file doesn't exist. This means you've solved your issue!

Just change your webpack config to suit your CSS or SCSS file structure, and you're good to go!

ITwrx commented

cool, thanks again!