mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 16:14:31 +00:00
fix(update): add shell option for Windows npm/cache spawn
On Windows, spawn needs shell:true to find npm.cmd. Without it, ENOENT error occurs causing update failure. Fixes #85
This commit is contained in:
1 parent
466cb0ad8b
commit
8c1b8e49ae
1 file changed
+2
@@ -235,6 +235,7 @@ async function performNpmUpdate(
|
|||||||
const performUpdate = (): void => {
|
const performUpdate = (): void => {
|
||||||
const child = spawn(updateCommand, updateArgs, {
|
const child = spawn(updateCommand, updateArgs, {
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
|
shell: process.platform === 'win32',
|
||||||
});
|
});
|
||||||
|
|
||||||
child.on('exit', (code) => {
|
child.on('exit', (code) => {
|
||||||
@@ -270,6 +271,7 @@ async function performNpmUpdate(
|
|||||||
console.log(info('Clearing package cache...'));
|
console.log(info('Clearing package cache...'));
|
||||||
const cacheChild = spawn(cacheCommand, cacheArgs, {
|
const cacheChild = spawn(cacheCommand, cacheArgs, {
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
|
shell: process.platform === 'win32',
|
||||||
});
|
});
|
||||||
|
|
||||||
cacheChild.on('exit', (code) => {
|
cacheChild.on('exit', (code) => {
|
||||||
|
|||||||
Reference in new issue
Block a user