运行 角度项目位于不同于 C:\Program Files\nodejs (powershell) 的其他路径

Run angullar project located in another path than C:\Program Files\nodejs (powershel)

我在此路径中有一个 angular 项目 "C:\GitSuperFood\supafoo\mockup\V1\demoSuper" 我想 运行 ng 服务于 运行 路径中提到的 angular 项目 多于 当我在这条路径上打开 power shell 命令时 "C:\GitSuperFood\supafoo\mockup\V1\demoSuper" 和 运行 "ng serve" 我得到这个错误

Could not find module "@angular-devkit/build-angular" from 
"C:\GitSuperFood\supafoo\mockup\V1\demoSuper".
 Error: Could not find module "@angular-devkit/build-angular" from 
 "C:\GitSuperFood\supafoo\mockup\V1\demoSuper".
at Object.resolve (C:\Users\עילי 
ושקד\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular- 
  devkit\core\node\resolve.js:151:11)
at WorkspaceNodeModulesArchitectHost.resolveBuilder (C:\Users\עילי 


  ושקד\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular- 
 devkit\architect\node\node-modules-architect-host.js:31:40)
at ServeCommand.initialize (C:\Users\עילי 
  ושקד\AppData\Roaming\npm\node_modules\@angular\cli\models\architect- 
 command.js:135:55)
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)

在 运行 使用 ng serve 命令之前,我执行了以下步骤

有什么建议吗?

如果您通过 运行ning npm install 或 shorthand [=11= 从 github 克隆项目,则需要安装 angular 依赖项]

当您将项目上传到 GitHub 进行优化时,您仅共享 package.jsonpackage-lock.json 作为您的依赖项的参考,但您离开了实际的 node_modules 目录被推送到您的 github 存储库

这就是为什么你需要 运行 npm 告诉 npm 从 package.json 和 package-lock.json[=14 生成 node_modules 文件夹=]

Could not find module "@angular-devkit/build-angular"

这是一个很好的提示,它在您项目的 node_modules 文件夹中丢失了。 实际上,正如罗伯特提到的 运行

npm install

在你的项目文件夹@C:\GitSuperFood\supafoo\mockup\V1\demoSuper