Skip to content

Commit bba3bb1

Browse files
committed
feat(create-app): prompt for npm agent on installing
1 parent 3113037 commit bba3bb1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

packages/create-app/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const argv = require('minimist')(process.argv.slice(2))
88
const prompts = require('prompts')
99
const execa = require('execa')
1010
const { cyan, blue, yellow, bold, dim, green } = require('kolorist')
11+
const { parseNi, run } = require('@antfu/ni')
1112
const { version } = require('./package.json')
1213

1314
const cwd = process.cwd()
@@ -107,7 +108,8 @@ async function init() {
107108
})
108109

109110
if (yes) {
110-
await execa(pkgManager, ['-C', related, 'install'], { stdio: 'inherit' })
111+
await run(parseNi, ['-C', related, 'install'])
112+
// await execa(pkgManager, ['-C', related, 'install'], { stdio: 'inherit' })
111113
await execa(pkgManager, ['-C', related, 'run', 'dev'], { stdio: 'inherit' })
112114
}
113115
else {

packages/create-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"homepage": "https://github.com/slidevjs/slidev",
1717
"bugs": "https://github.com/slidevjs/slidev/issues",
1818
"dependencies": {
19+
"@antfu/ni": "^0.5.8",
1920
"execa": "^5.0.0",
2021
"kolorist": "^1.4.1",
2122
"minimist": "^1.2.5",

pnpm-lock.yaml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)