Skip to content

Commit b7f2e84

Browse files
committed
fix(registry): run npx via shell on Windows to avoid ENOENT error
1 parent 13151ee commit b7f2e84

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/registry/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ if (args.length >= 2 && args[0] === 'add') {
2929
const component = args[1]
3030
const targetUrl = new URL(`/${component}.json`, 'https://registry.ai-elements-vue.com').toString()
3131

32-
const [command, ...commandArgs] = commandPrefix.split(' ')
33-
const result = spawnSync(command, [...commandArgs, 'shadcn-vue@latest', 'add', targetUrl], {
32+
const fullCommand = `${commandPrefix} shadcn-vue@latest add ${targetUrl}`
33+
const result = spawnSync(fullCommand, {
3434
stdio: 'inherit',
35-
shell: false,
35+
shell: true,
3636
})
3737

3838
if (result.error) {
@@ -56,10 +56,10 @@ else {
5656
new URL(`/${item.name}.json`, 'https://registry.ai-elements-vue.com').toString(),
5757
)
5858

59-
const [command, ...commandArgs] = commandPrefix.split(' ')
60-
const result = spawnSync(command, [...commandArgs, 'shadcn-vue@latest', 'add', ...componentUrls], {
59+
const fullCommand = `${commandPrefix} shadcn-vue@latest add ${componentUrls.join(' ')}`
60+
const result = spawnSync(fullCommand, {
6161
stdio: 'inherit',
62-
shell: false,
62+
shell: true,
6363
})
6464

6565
if (result.error) {

0 commit comments

Comments
 (0)