ng v命令给出错误:'“ path”参数必须是字符串,缓冲区或URL类型之一。收到的类型对象

时间:2019-07-22 06:07:03

标签: angular

在运行ng v命令时遇到路径错误。

我希望ng v返回角度版本,但出现以下错误:

The "path" argument must be one of type string, Buffer, or URL. Received 
type object
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type 
string, Buffer, or URL. Received type object
at Object.readdirSync (fs.js:785:3)
at VersionCommand.run 
(C:\node_modules\@angular\cli\commands\version.js:48:19)
at C:\node_modules\@angular\cli\models\command-runner.js:278:30
at Generator.next (<anonymous>)
at fulfilled (C:\node_modules\@angular\cli\models\command-runner.js:4:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

1 个答案:

答案 0 :(得分:0)

好像您在“ c:\”中有一个“ node_modules”文件夹。我有同样的问题。通过删除“ c:\ node_modules”对其进行了修复。