TypeError:升级到NestJs 5.1时无法读取属性“名称”错误

时间:2018-07-10 18:18:02

标签: upgrade typeerror nestjs

我正在尝试将我的nestjs从5.0.beta升级到5.1。

在引导时,出现以下错误。不知道在哪里寻找解决方案。谢谢你的帮助。

TypeError: Cannot read property 'name' of undefined
    at Module.addModuleAsComponent (myApp/node_modules/@nestjs/core/injector/module.js:72:45)
    at Module.addCoreInjectables (myApp/node_modules/@nestjs/core/injector/module.js:56:14)
    at new Module (myApp/node_modules/@nestjs/core/injector/module.js:24:14)
    at NestContainer.addModule (myApp/node_modules/@nestjs/core/injector/container.js:35:24)
    at DependenciesScanner.storeModule (myApp/node_modules/@nestjs/core/scanner.js:32:30)
    at DependenciesScanner.scanForModules (myApp/node_modules/@nestjs/core/scanner.js:22:20)
    at DependenciesScanner.scan (myApp/node_modules/@nestjs/core/scanner.js:17:20)
    at exceptions_zone_1.ExceptionsZone.asyncRun (myApp/node_modules/@nestjs/core/nest-factory.js:75:43)
    at Function.asyncRun (myApp/node_modules/@nestjs/core/errors/exceptions-zone.js:17:19)
    at NestFactoryStatic.initialize (myApp/node_modules/@nestjs/core/nest-factory.js:74:52)
1: node::Abort() [/usr/local/Cellar/node/9.7.1_1/bin/node]
2: node::Chdir(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/Cellar/node/9.7.1_1/bin/node]
3: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [/usr/local/Cellar/node/9.7.1_1/bin/node]
4: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/usr/local/Cellar/node/9.7.1_1/bin/node]
5: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/Cellar/node/9.7.1_1/bin/node]
6: 0x383450a842fd

1 个答案:

答案 0 :(得分:1)

原来,删除并重新安装node_modules后,问题消失了