“ path”参数必须为字符串类型。收到的类型对象

时间:2019-06-17 05:45:34

标签: angular typescript

我已经更新了我的角度应用程序,并且在运行ng serve时,我遇到了这个问题。我尝试使用npm install进行全新克隆,但此问题仍然存在。

The "path" argument must be of type string. Received type object
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
    at validateString (internal/validators.js:125:11)
    at Object.join (path.js:427:7)
    at module.exports (D:\angular\team-management\node_modules\array-flatten\index.js:7:15)
    at Function.use (D:\angular\team-management\node_modules\express\lib\router\index.js:448:19)
    at Function.lazyrouter (D:\angular\team-management\node_modules\express\lib\application.js:144:18)
    at Function.all (D:\angular\team-management\node_modules\express\lib\application.js:498:8)
    at new Server (D:\angular\team-management\node_modules\webpack-dev-server\lib\Server.js:180:9)
    at Observable.rxjs_1.Observable.obs [as _subscribe] (D:\angular\team-management\node_modules\@angular-devkit\build-webpack\src\webpack-dev-server\index.js:35:24)
    at Observable._trySubscribe (D:\angular\team-management\node_modules\@angular-devkit\build-webpack\node_modules\rxjs\internal\Observable.js:44:25)
    at Observable.subscribe (D:\angular\team-management\node_modules\@angular-devkit\build-webpack\node_modules\rxjs\internal\Observable.js:30:22)
    at D:\angular\team-management\node_modules\@angular-devkit\build-webpack\node_modules\rxjs\internal\util\subscribeTo.js:22:31
    at Object.subscribeToResult (D:\angular\team-management\node_modules\@angular-devkit\build-webpack\node_modules\rxjs\internal\util\subscribeToResult.js:10:45)
    at SwitchMapSubscriber._innerSub (D:\angular\team-management\node_modules\@angular-devkit\build-webpack\node_modules\rxjs\internal\operators\switchMap.js:65:54)
    at SwitchMapSubscriber._next (D:\angular\team-management\node_modules\@angular-devkit\build-webpack\node_modules\rxjs\internal\operators\switchMap.js:55:14)
    at SwitchMapSubscriber.Subscriber.next (D:\angular\team-management\node_modules\@angular-devkit\build-webpack\node_modules\rxjs\internal\Subscriber.js:66:18)
    at Observable._subscribe (D:\angular\team-management\node_modules\@angular-devkit\build-webpack\node_modules\rxjs\internal\observable\scalar.js:6:20)

我的棱角版本是:

Angular CLI: 8.0.3
Node: 10.16.0
OS: win32 x64
Angular: 8.0.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.3
@angular-devkit/build-angular     0.800.3
@angular-devkit/build-optimizer   0.800.3
@angular-devkit/build-webpack     0.800.3
@angular-devkit/core              8.0.3
@angular-devkit/schematics        8.0.3
@angular/cli                      8.0.3
@angular/fire                     5.2.1
@ngtools/webpack                  8.0.3
@schematics/angular               8.0.3
@schematics/update                0.800.3
rxjs                              6.5.2
typescript                        3.5.2
webpack                           4.30.0

我是Angular的新手,非常感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

我刚刚重新安装了express和path软件包,就解决了这个问题。