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

SvelteKit fails to create on Void Linux due to conflict with runit system init #12950

Closed
catielanier opened this issue Nov 4, 2024 · 1 comment

Comments

@catielanier
Copy link

catielanier commented Nov 4, 2024

Describe the bug

SvelteKit will not build on Linux systems using the runit init software (namely Void Linux, which comes default with runit) due to a conflict within the init software. Runit uses a binary named sv to check for running services. npx/npm/yarn will still attempt to point to this binary file when attempting to create the project, which will send the error "unable to change to service directory: file does not exist" expecting an initialization service instead of a directory as an argument.

Reproduction

  • Create a virtualized install of Void Linux
  • Install Nodejs + NPM (sudo xbps-install -S nodejs npm)
  • use the command to create a new sveltekit app (npx sv create my-app)
  • observe error
  • use the command which sv to determine that sv points to /usr/bin/sv which is the runit service binary.

Logs

0 verbose cli /usr/bin/node /usr/bin/npm
1 info using [email protected]
2 info using [email protected]
3 silly config load:file:/usr/lib/node_modules/npm/npmrc
4 silly config load:file:/home/catie/projects/.npmrc
5 silly config load:file:/home/catie/.npmrc
6 silly config load:file:/usr/etc/npmrc
7 verbose title npm create vite@latest
8 verbose argv "create" "vite@latest"
9 verbose logfile logs-max:10 dir:/home/catie/.npm/_logs/2024-11-04T21_09_41_467Z-
10 verbose logfile /home/catie/.npm/_logs/2024-11-04T21_09_41_467Z-debug-0.log
11 silly logfile start cleaning logs, removing 1 files
12 silly logfile done cleaning log files
13 silly packumentCache heap:4345298944 maxSize:1086324736 maxEntrySize:543162368
14 http fetch GET 200 https://registry.npmjs.org/create-vite 209ms (cache updated)
15 silly packumentCache heap:4345298944 maxSize:1086324736 maxEntrySize:543162368
16 silly idealTree buildDeps
17 silly fetch manifest [email protected]
18 silly packumentCache full:https://registry.npmjs.org/create-vite cache-miss
19 http fetch GET 200 https://registry.npmjs.org/create-vite 316ms (cache updated)
20 silly packumentCache full:https://registry.npmjs.org/create-vite set size:undefined disposed:false
21 silly placeDep ROOT [email protected] REPLACE for:  want: 5.5.5
22 silly reify mark retired [
22 silly reify   '/home/catie/.npm/_npx/1415fee72ff6294b/node_modules/create-vite',
22 silly reify   '/home/catie/.npm/_npx/1415fee72ff6294b/node_modules/.bin/create-vite',
22 silly reify   '/home/catie/.npm/_npx/1415fee72ff6294b/node_modules/.bin/cva'
22 silly reify ]
23 silly reify moves {
23 silly reify   '/home/catie/.npm/_npx/1415fee72ff6294b/node_modules/create-vite': '/home/catie/.npm/_npx/1415fee72ff6294b/node_modules/.create-vite-lWj4kYhm',
23 silly reify   '/home/catie/.npm/_npx/1415fee72ff6294b/node_modules/.bin/create-vite': '/home/catie/.npm/_npx/1415fee72ff6294b/node_modules/.bin/.create-vite-auJWzfOO',
23 silly reify   '/home/catie/.npm/_npx/1415fee72ff6294b/node_modules/.bin/cva': '/home/catie/.npm/_npx/1415fee72ff6294b/node_modules/.bin/.cva-c8Quc8oq'
23 silly reify }
24 silly audit bulk request { 'create-vite': [ '5.5.5' ] }
25 silly tarball no local data for create-vite@https://registry.npmjs.org/create-vite/-/create-vite-5.5.5.tgz. Extracting by manifest.
26 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 100ms
27 silly audit report {}
28 http fetch GET 200 https://registry.npmjs.org/create-vite/-/create-vite-5.5.5.tgz 188ms (cache miss)
29 verbose stack Error: command failed
29 verbose stack     at promiseSpawn (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
29 verbose stack     at spawnWithShell (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
29 verbose stack     at promiseSpawn (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
29 verbose stack     at runScriptPkg (/usr/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:77:13)
29 verbose stack     at runScript (/usr/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
29 verbose stack     at run (/usr/lib/node_modules/npm/node_modules/libnpmexec/lib/run-script.js:48:10)
29 verbose stack     at async exec (/usr/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:289:10)
29 verbose stack     at async Init.execCreate (/usr/lib/node_modules/npm/lib/commands/init.js:136:5)
29 verbose stack     at async Init.exec (/usr/lib/node_modules/npm/lib/commands/init.js:44:14)
29 verbose stack     at async Npm.exec (/usr/lib/node_modules/npm/lib/npm.js:207:9)
30 error code 1
31 error path /home/catie/projects
32 error command failed
33 error command sh -c create-vite
34 verbose cwd /home/catie/projects
35 verbose os Linux 6.11.6_1
36 verbose node v20.16.0
37 verbose npm  v10.8.1
38 verbose exit 1
39 verbose code 1
40 error A complete log of this run can be found in: /home/catie/.npm/_logs/2024-11-04T21_09_41_467Z-debug-0.log

System Info

System:
    OS: Linux 6.11 Void
    CPU: (8) x64 AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx
    Memory: 28.67 GB / 31.04 GB
    Container: Yes
    Shell: 5.2.32 - /bin/bash
  Binaries:
    Node: 20.16.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 10.8.1 - /usr/bin/npm
  Browsers:
    Chromium: 130.0.6723.69

Severity

blocking all usage of SvelteKit

Additional Information

This can impact any Linux system where the end user might have migrated their system init software to runit over its default (systemd, initrc, sysv, etc.)

@Conduitry
Copy link
Member

Duplicate of sveltejs/cli#259

A workaround is to run npx sv@latest or to use a different package manager which doesn't prefer other local binaries.

@Conduitry Conduitry closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2024
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

2 participants