package.json
{
"name": "client",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^8.2.14",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/http": "^7.2.16",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@angular/router": "^8.2.14",
"core-js": "^3.6.4",
"rxjs": "~6.5.4",
"handlebars": "4.7.2",
"fstream": "1.0.12",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.23",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^8.2.14",
"@types/jasmine": "~3.5.1",
"@types/jasminewd2": "~2.0.8",
"@types/node": "~13.1.8",
"codelyzer": "~5.2.1",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.1",
"karma-jasmine": "~3.1.0",
"karma-jasmine-html-reporter": "^1.5.1",
"protractor": "~5.4.2",
"ts-node": "~8.6.2",
"tslint": "~5.20.1",
"typescript": "~3.4.5"
}
}
终端输出
An unhandled exception occurred: Cannot find module '@angular/compiler-cli'
See "C:\Users\07\AppData\Local\Temp\ng-ADfZrp\angular-errors.log" for further details.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file C:\WINDOWS\system32\cmd.exe
npm ERR! errno ENOENT
npm ERR! client@0.0.0 build: `ng build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the client@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\07\AppData\Roaming\npm-cache\_logs\2020-04-30T03_30_23_559Z-debug.log
The terminal process terminated with exit code: 1
调试日志
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm@6.14.4
3 info using node@v10.20.1
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle client@0.0.0~prebuild: client@0.0.0
6 info lifecycle client@0.0.0~build: client@0.0.0
7 verbose lifecycle client@0.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle client@0.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\07\OneDrive\Desktop\final try5\fabcar-blockchain-sample\web-app\client\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk-12.0.2\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Go\bin;C:\Users\07\.windows-build-tools\python27\;C:\Users\07\AppData\Local\Microsoft\WindowsApps;C:\Users\07\AppData\Local\GitHubDesktop\bin;C:\Users\07\AppData\Roaming\npm;C:\Users\07\go\bin
9 verbose lifecycle client@0.0.0~build: CWD: C:\Users\07\OneDrive\Desktop\final try5\fabcar-blockchain-sample\web-app\client
10 silly lifecycle client@0.0.0~build: Args: [ '/d /s /c', 'ng build' ]
11 info lifecycle client@0.0.0~build: Failed to exec build script
12 verbose stack Error: client@0.0.0 build: `ng build`
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:198:13)
12 verbose stack at maybeClose (internal/child_process.js:982:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
13 verbose pkgid client@0.0.0
14 verbose cwd C:\Users\07\OneDrive\Desktop\final try5\fabcar-blockchain-sample\web-app\client
15 verbose Windows_NT 10.0.16299
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
17 verbose node v10.20.1
18 verbose npm v6.14.4
19 error code ELIFECYCLE
20 error syscall spawn
21 error file C:\WINDOWS\system32\cmd.exe
22 error errno ENOENT
23 error client@0.0.0 build: `ng build`
23 error spawn ENOENT
24 error Failed at the client@0.0.0 build script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
angular-errors.log
[error] Error: Cannot find module '@angular/compiler-cli'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\07\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:12:24)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\07\node_modules\@ngtools\webpack\src\index.js:13:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
实际上,我正在这里开发一个Hyperledger项目。因此,我从此站点https://github.com/IBM/fabcar-blockchain-sample克隆了该项目。当我尝试打包打开项目/使其成为智能合约时,出现上述错误。所以有人请帮助我...