我已经克隆了一个 git 存储库,它是一个 Angular 7 和 .NET Core 应用程序,项目中一切正常,但是当我尝试恢复 npm 包时,出现以下错误。
\Microsoft\TeamFoundation\Team Explorer\Git\cmd\git.EXE 子模块
更新-q --init --recursive
fatal: 'submodule' 似乎是一个 git 命令,但我们不是
能够执行它。也许 git-submodule 坏了?
在 ChildProcess.exithandler (child_process.js:291:12)
在 ChildProcess.emit (events.js:182:13)
在 MaybeClose (内部/child_process.js:961:16)
在 Process.ChildProcess._handle.onexit (内部/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
is 10.7.0
and npm-version
is 6.4.1
我在 GitHub 上发现了一些这样的问题,他们在 npm-lifecycle 中添加了修复程序,所以我安装了npm-lifecycle
但我仍然遇到同样的错误。