找不到工作区文件(';angular.json';)

找不到工作区文件(';angular.json';),angular,npm,angular-cli,npm-install,angular-cli-v6,Angular,Npm,Angular Cli,Npm Install,Angular Cli V6,我试图使用ng serve运行角度应用程序,但出现以下错误: Local workspace file ('angular.json') could not be found. Error: Local workspace file ('angular.json') could not be found. at WorkspaceLoader._getProjectWorkspaceFilePath (C:\Users\Roy\AppData\Roaming\npm\node_modul

我试图使用
ng serve
运行角度应用程序,但出现以下错误:

Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
    at WorkspaceLoader._getProjectWorkspaceFilePath (C:\Users\Roy\AppData\Roaming\npm\node_modules\@angular\cli\models\workspace-loader.js:38:19)
    at WorkspaceLoader.loadWorkspace (C:\Users\Roy\AppData\Roaming\npm\node_modules\@angular\cli\models\workspace-loader.js:25:21)
    at ServeCommand._loadWorkspaceAndArchitect (C:\Users\Roy\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:181:32)
    at ServeCommand.<anonymous> (C:\Users\Roy\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:48:25)
    at Generator.next (<anonymous>)
    at C:\Users\Roy\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Roy\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:3:12)
    at ServeCommand.initialize (C:\Users\Roy\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:47:16)
    at Object.<anonymous> (C:\Users\Roy\AppData\Roaming\npm\node_modules\@angular\cli\models\command-runner.js:83:23)
在项目文件夹中运行时:

ng -v

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 6.1.0-beta.2
Node: 8.11.2
OS: win32 x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.7.0-beta.2 (cli-only)
@angular-devkit/core         0.7.0-beta.2 (cli-only)
@angular-devkit/schematics   0.7.0-beta.2 (cli-only)
@angular/cdk                 5.2.4
@angular/cli                 <error>
@angular/material            5.2.4
@schematics/angular          0.7.0-beta.2 (cli-only)
@schematics/update           0.7.0-beta.2 (cli-only)
rxjs                         5.5.7
typescript                   2.4.2

我明白了,我在git环境中工作,有人推送了一个npmrc文件,其设置只允许从我们的内部服务器下载,这就是为什么每次我运行
npm安装时我都在尝试下载angular cli时出错。

我今天遇到了这个问题。我的情况没有什么错,只是一个愚蠢的错误。我在我的应用程序目录(其中包含
node\u模块
)之外运行我的命令
ng serve
和其他
angular cli
命令。因此,在使用
cd m4moviesapp
移动到该目录后,然后运行
ng serve
,一切正常

目录

之前

之后


这是因为您已在某个目录中安装angular,并试图在不创建新项目设置的情况下使用ng serve
通过开发服务器生成和服务角度项目 ng新项目名称 cd项目名称 ng发球

我运行了“npm安装”,我的项目得到了所有模块并运行了。

你在angular项目中吗?在运行此命令“npm cache clean-f”后尝试运行相同的命令。是的,我在angular项目中。我尝试运行了
npm cache clean-f
然后运行npm安装,但仍然得到相同的错误
ng -v

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 6.1.0-beta.2
Node: 8.11.2
OS: win32 x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.7.0-beta.2 (cli-only)
@angular-devkit/core         0.7.0-beta.2 (cli-only)
@angular-devkit/schematics   0.7.0-beta.2 (cli-only)
@angular/cdk                 5.2.4
@angular/cli                 <error>
@angular/material            5.2.4
@schematics/angular          0.7.0-beta.2 (cli-only)
@schematics/update           0.7.0-beta.2 (cli-only)
rxjs                         5.5.7
typescript                   2.4.2
npm install
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to http://172.23.4.20:4873/@angular%2fcli failed, reason: read ECONNRESET
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Roy\AppData\Roaming\npm-cache\_logs\2018-06-11T09_24_47_695Z-debug.log