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

时间:2020-03-20 03:16:53

标签: javascript angular typescript npm

我正在使用Angular 8,如果我使用命令“ ng serve”,则会在angular-error.log中得到此错误:

[error] TypeError: Object prototype may only be an Object or null: undefined
    at setPrototypeOf (<anonymous>)
    at Object.__extends (C:\xxxx\xxxx\xxxx\xxxx\07-bonus-LoginApp\node_modules\tslib\tslib.js:67:9)
    at C:\xxxx\xxxx\xxxx\xxxx\07-bonus-LoginApp\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:115:17
    at C:\xxxx\xxxx\xxxx\xxxx\07-bonus-LoginApp\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:314:6
    at C:\xxxx\xxxx\xxxx\xxxx\07-bonus-LoginApp\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:3:17
    at Object.<anonymous> (C:\xxxx\xxxx\xxxx\xxxx\07-bonus-LoginApp\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\template.js:9:3)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at C:\xxxx\xxxx\xxxx\xxxx\07-bonus-LoginApp\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:20:22
    at C:\xxxx\xxxx\xxxx\xxxx\07-bonus-LoginApp\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:10:17
    at Object.<anonymous> (C:\xxxx\xxxx\xxxx\xxxx\07-bonus-LoginApp\node_modules\@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:16:3)
    at Module._compile (internal/modules/cjs/loader.js:955:30)

我已经尝试删除node_modules并运行 npm install 命令和 npm clean-install ,但是它不起作用,有人可以帮我吗?

0 个答案:

没有答案