对象原型只能是一个对象或为空:未定义TypeError:对象原型只能是一个对象或为空:未定义

时间:2019-09-18 09:14:43

标签: angular typescript npm npm-start

我是新手。不了解此问题以及由于无知引起的基本错误消息。
我使用npm install安装了外部模块。在那之后,当我运行 npm start 时,它给出了这样的错误。我不知道此错误,请帮助解决此问题。在安装该模块之前,该项目运行良好。

npm启动后的错误

E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0>npm start

> now-ui-dashboard-angular@1.1.0 start E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0
> ng serve --proxy-config proxy.json

Object prototype may only be an Object or null: undefined
TypeError: Object prototype may only be an Object or null: undefined
    at setPrototypeOf (<anonymous>)
    at Object.__extends (E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0\node_modules\tslib\tslib.js:65:9)
    at E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:115:17
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:20:22
    at E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:10:17
    at Object.<anonymous> (E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:16:3)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! now-ui-dashboard-angular@1.1.0 start: `ng serve --proxy-config proxy.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the now-ui-dashboard-angular@1.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Udith Indrakantha\AppData\Roaming\npm-cache\_logs\2019-09-18T08_23_43_449Z-debug.log

debug.log文件

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   'start' ]
2 info using npm@6.4.1
3 info using node@v10.15.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle now-ui-dashboard-angular@1.1.0~prestart: now-ui-dashboard-angular@1.1.0
6 info lifecycle now-ui-dashboard-angular@1.1.0~start: now-ui-dashboard-angular@1.1.0
7 verbose lifecycle now-ui-dashboard-angular@1.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle now-ui-dashboard-angular@1.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0\node_modules\.bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files\nodejs\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Java\jdk1.8.0_45\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\software setup\mysql\mysql-8.0.15-winx64\bin;C:\Program Files (x86)\Rational\common;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\TDM-GCC-64\bin;C:\src\flutter\bin;C:\Program Files\Git\cmd;C:\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby2.3.3\bin;C:\Ruby25-x64\bin;C:\Users\Udith Indrakantha\AppData\Local\Microsoft\WindowsApps;;C:\Users\Udith Indrakantha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Udith Indrakantha\AppData\Roaming\npm
9 verbose lifecycle now-ui-dashboard-angular@1.1.0~start: CWD: E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0
10 silly lifecycle now-ui-dashboard-angular@1.1.0~start: Args: [ '/d /s /c', 'ng serve --proxy-config proxy.json' ]
11 silly lifecycle now-ui-dashboard-angular@1.1.0~start: Returned: code: 1  signal: null
12 info lifecycle now-ui-dashboard-angular@1.1.0~start: Failed to exec start script
13 verbose stack Error: now-ui-dashboard-angular@1.1.0 start: `ng serve --proxy-config proxy.json`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid now-ui-dashboard-angular@1.1.0
15 verbose cwd E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v10.15.1
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error now-ui-dashboard-angular@1.1.0 start: `ng serve --proxy-config proxy.json`
22 error Exit status 1
23 error Failed at the now-ui-dashboard-angular@1.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

运行 ng --version

Angular CLI: 7.2.3
Node: 10.15.1
OS: win32 x64
Angular: 7.2.2
... animations, common, compiler, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.12.4
@angular-devkit/build-angular     0.12.4
@angular-devkit/build-optimizer   0.12.4
@angular-devkit/build-webpack     0.12.4
@angular-devkit/core              7.2.4
@angular-devkit/schematics        7.2.3
@angular/cli                      7.2.3
@angular/compiler-cli             8.2.0
@angular/fire                     5.2.1
@ngtools/webpack                  7.2.4
@schematics/angular               7.2.3
@schematics/update                0.12.3
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.28.4

运行 ng审核修复程序

E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0>npm audit fix 

> core-js@3.1.4 postinstall E:\Software Project Confidential\Patronus Project Latest\Frontend 1.0\node_modules\@firebase\polyfill\node_modules\core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

npm WARN @angular/compiler-cli@8.2.0 requires a peer of @angular/compiler@8.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngtools/webpack@7.2.4 requires a peer of @angular/compiler-cli@>=5.0.0 <8.0.0 || ^7.0.0-beta.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngtools/webpack@7.2.4 requires a peer of typescript@>=2.4.0 < 3.3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.

added 18 packages from 3 contributors and updated 2 packages in 32.862s
fixed 1 of 1 vulnerability in 40745 scanned packages

package.json

{
  "name": "now-ui-dashboard-angular",
  "version": "1.1.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --proxy-config proxy.json",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "7.2.2",
    "@angular/common": "7.2.2",
    "@angular/compiler": "7.2.2",
    "@angular/core": "7.2.2",
    "@angular/fire": "^5.2.1",
    "@angular/forms": "7.2.2",
    "@angular/http": "7.2.2",
    "@angular/platform-browser": "7.2.2",
    "@angular/platform-browser-dynamic": "7.2.2",
    "@angular/platform-server": "7.2.2",
    "@angular/router": "7.2.2",
    "@ng-bootstrap/ng-bootstrap": "4.0.2",
    "ajv": "6.7.0",
    "ajv-keywords": "3.3.0",
    "angularfire2": "^5.2.1",
    "bootstrap": "^4.3.1",
    "chart.js": "2.7.3",
    "chartist": "0.11.0",
    "classlist.js": "1.1.20150312",
    "copy-webpack-plugin": "4.6.0",
    "core-js": "2.6.3",
    "firebase": "^6.3.4",
    "font-awesome": "4.7.0",
    "hammerjs": "2.0.8",
    "jquery": "^3.4.1",
    "jw-bootstrap-switch-ng2": "2.0.4",
    "ng2-charts": "1.6.0",
    "ngx-bootstrap": "^5.1.0",
    "ngx-print": "^1.2.0-beta.2",
    "ngx-toastr": "^9.1.1",
    "node-sass": "^4.12.0",
    "nouislider": "12.1.0",
    "perfect-scrollbar": "1.4.0",
    "popper.js": "1.14.6",
    "rellax": "1.7.2",
    "rxjs": "^6.3.3",
    "tslib": "^1.9.3",
    "web-animations-js": "2.3.1",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.12.4",
    "@angular/cli": "7.2.3",
    "@angular/compiler-cli": "^8.2.0",
    "@angular/language-service": "7.2.2",
    "@types/bootstrap": "4.2.1",
    "@types/chartist": "0.9.43",
    "@types/googlemaps": "3.30.16",
    "@types/jasmine": "3.3.8",
    "@types/jquery": "3.3.29",
    "@types/jspdf": "^1.3.1",
    "@types/node": "10.12.18",
    "codelyzer": "4.5.0",
    "jasmine-core": "3.3.0",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "^4.2.0",
    "karma-chrome-launcher": "2.2.0",
    "karma-cli": "2.0.0",
    "karma-coverage-istanbul-reporter": "2.0.4",
    "karma-jasmine": "2.0.1",
    "protractor": "5.4.2",
    "ts-node": "8.0.2",
    "tslint": "5.12.1",
    "typescript": "3.4.5"
  }
}

0 个答案:

没有答案