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

Installing using npm fails on postinstall script #2519

Closed
phqshy opened this issue Sep 4, 2022 · 1 comment
Closed

Installing using npm fails on postinstall script #2519

phqshy opened this issue Sep 4, 2022 · 1 comment

Comments

@phqshy
Copy link

phqshy commented Sep 4, 2022

Running Windows 10 with node version 18.8.0 (I updated to try and fix this problem, this occurred on 16.17.0 too), first encountered this while trying to create a new svelte app using https://github.com/sveltejs/kit.

I've tried versions 0.14.5, 0.15.6, and 0.14.17, and all three of them fail when running npm install esbuild@[version] or installing the version bundled with svelte using npm install. All I did was follow the instructions for sveltekit https://kit.svelte.dev/docs/introduction#getting-started. Here's the last lines in the debug log:

1706 timing command:install Completed in 8424ms
1707 verbose stack Error: command failed
1707 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:63:27)
1707 verbose stack     at ChildProcess.emit (node:events:513:28)
1707 verbose stack     at maybeClose (node:internal/child_process:1091:16)
1707 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
1708 verbose pkgid esbuild@0.15.6
1709 verbose cwd C:\Users\[user]\Documents\svelte\quizme
1710 verbose Windows_NT 10.0.19044
1711 verbose node v18.8.0
1712 verbose npm  v8.18.0
1713 error code 1
1714 error path C:\Users\[user]\Documents\svelte\quizme\node_modules\esbuild
1715 error command failed
1716 error command C:\Windows\system32\cmd.exe /d /s /c node install.js
1717 error node:internal/errors:484
1717 error     ErrorCaptureStackTrace(err);
1717 error     ^
1717 error
1717 error <ref *1> Error: spawnSync node ENOENT
1717 error     at Object.spawnSync (node:internal/child_process:1110:20)
1717 error     at spawnSync (node:child_process:857:24)
1717 error     at Object.execFileSync (node:child_process:900:15)
1717 error     at validateBinaryVersion (C:\Users\[user]\Documents\svelte\quizme\node_modules\esbuild\install.js:89:32)
1717 error     at C:\Users\[user]\Documents\svelte\quizme\node_modules\esbuild\install.js:240:5 {
1717 error   errno: -4058,
1717 error   code: 'ENOENT',
1717 error   syscall: 'spawnSync node',
1717 error   path: 'node',
1717 error   spawnargs: [
1717 error     'C:\\Users\\[user]\\Documents\\svelte\\quizme\\node_modules\\esbuild\\bin\\esbuild',
1717 error     '--version'
1717 error   ],
1717 error   error: [Circular *1],
1717 error   status: null,
1717 error   signal: null,
1717 error   output: null,
1717 error   pid: 0,
1717 error   stdout: null,
1717 error   stderr: null
1717 error }
1717 error
1717 error Node.js v18.8.0
1718 verbose exit 1
1719 timing npm Completed in 8755ms
1720 verbose unfinished npm timer reify 1662254427790
1721 verbose unfinished npm timer reify:build 1662254434938
1722 verbose unfinished npm timer build 1662254434939
1723 verbose unfinished npm timer build:deps 1662254434939
1724 verbose unfinished npm timer build:run:postinstall 1662254434990
1725 verbose unfinished npm timer build:run:postinstall:node_modules/@sveltejs/kit 1662254434990
1726 verbose unfinished npm timer build:run:postinstall:node_modules/esbuild 1662254435028
1727 verbose unfinished npm timer build:run:postinstall:node_modules/@sveltejs/adapter-cloudflare/node_modules/esbuild 1662254435064
1728 verbose unfinished npm timer build:run:postinstall:node_modules/@sveltejs/adapter-netlify/node_modules/esbuild 1662254435104
1729 verbose unfinished npm timer build:run:postinstall:node_modules/@sveltejs/adapter-vercel/node_modules/esbuild 1662254435143
1730 verbose code 1
1731 error A complete log of this run can be found in:
1731 error     C:\Users\[user]\AppData\Local\npm-cache\_logs\2022-09-04T01_20_27_473Z-debug-0.log
@evanw
Copy link
Owner

evanw commented Sep 4, 2022

spawnSync node ENOENT

The node executable is not in your path, which is very strange since you are installing a package meant for node. Think I might be able to work around this on esbuild's end, which I will try in the next version of esbuild. But if that doesn't work, you may need to fix this problem on your end. I don't know too much about Windows so unfortunately I'm not sure what you'd need to fix here.

@evanw evanw closed this as completed in bd06f13 Sep 4, 2022
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