在自制脚手架的时候,使用download-git-repo时报错信息如下:

Error: 'git clone' failed with status 128
    at ChildProcess.<anonymous> (D:\frontendStudy\nodejsStudy\02-LEARN_CLI\node_modules\_git-clone@0.1.0@git-clone\index.js:33:22)    
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)     
    at Pipe.<anonymous> (node:net:313:12)

解决办法为:
在URL后加上#master并且去掉{clone:true}

  download-git-repo('https://github.com/用户名/仓库名#master', project, err => {
    console.log("-----", err)
  });
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐