【发布时间】:2021-08-14 15:50:49
【问题描述】:
我克隆了一个 git 存储库,它是一个 Angular 7 和 .NET Core 应用程序,项目中一切正常,但是当我尝试恢复 npm 包时,我收到以下错误。
\Microsoft\TeamFoundation\Team Explorer\Git\cmd\git.EXE 子模块 更新 -q --init --recursive 致命的:“子模块”似乎是一个 git 命令,但我们不是 能够执行它。也许 git-submodule 坏了? 在 ChildProcess.exithandler (child_process.js:291:12) 在 ChildProcess.emit (events.js:182:13) 在可能关闭(内部/child_process.js:961:16) 在 Process.ChildProcess._handle.onexit (internal/child_process.js:248:5) npm 错误! cb() 从未调用过!
#Package.json
{
"name": "name",
"version": "6.1.1",
"license": "......",
"scripts": {
"ng": "ng",
"start": "ng serve --open",
"start-hmr": "ng serve --configuration hmr -sm=false",
"start-hmr-sourcemaps": "ng serve --hmr -e=hmr",
"build": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev",
"build-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev --stats-json",
"build-prod": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod",
"build-prod-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod --stats-json",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"bundle-report": "webpack-bundle-analyzer dist/stats.json"
},
"private": true,
"dependencies": {
"@agm/core": "1.0.0-beta.3",
"@angular/animations": "6.0.5",
"@angular/cdk": "6.2.1",
"@angular/common": "6.0.5",
"@angular/compiler": "6.0.5",
"@angular/core": "6.0.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.6.8",
"@angular/cli": "6.0.8",
"@angular/compiler-cli": "6.0.5",
"@angular/language-service": "6.0.5",
"@angularclass/hmr": "2.1.3",
"typescript": "2.7.2",
"webpack-bundle-analyzer": "2.13.1"
}
}
我安装的node-version 是10.7.0 和npm-version 是6.4.1
我在 GitHub 上发现了一些类似的问题,他们在 npm-lifecycle 中添加了一个修复程序,所以我安装了 npm-lifecycle,但我仍然遇到同样的错误。
【问题讨论】:
-
我不知道是不是问题,但是在您粘贴的命令中,'-q' 选项内有一个空格
标签: node.js git visual-studio npm npm-install