Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
can';升级Angular和project后找不到编译器ngcc模块_Angular_Npm_Angular Cli - Fatal编程技术网

can';升级Angular和project后找不到编译器ngcc模块

can';升级Angular和project后找不到编译器ngcc模块,angular,npm,angular-cli,Angular,Npm,Angular Cli,我刚刚将Angular cli和我的一个项目从7.0.7升级到7.1.0 我一直在跟踪并回答 现在,我尝试使用以下方法运行我的项目: ng serve --proxy-config proxy.conf.json 收到这个消息了吗 找不到模块'@angular/compiler cli/ngcc'错误:找不到 模块'@angular/compiler cli/ngcc' at Function.Module._resolveFilename (internal/modules/cjs/load

我刚刚将Angular cli和我的一个项目从7.0.7升级到7.1.0

我一直在跟踪并回答

现在,我尝试使用以下方法运行我的项目:

ng serve --proxy-config proxy.conf.json
收到这个消息了吗

找不到模块'@angular/compiler cli/ngcc'错误:找不到

模块'@angular/compiler cli/ngcc'

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15)

at Function.Module._load (internal/modules/cjs/loader.js:575:25)

at Module.require (internal/modules/cjs/loader.js:705:19)

at require (internal/modules/cjs/helpers.js:14:16)

at Object.<anonymous> (/Users/path/myproject/node_modules/@ngtools/webpack/src/ngcc_processor.js:10:16)

at Module._compile (internal/modules/cjs/loader.js:799:30)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)

at Module.load (internal/modules/cjs/loader.js:666:32)

at tryModuleLoad (internal/modules/cjs/loader.js:606:12)

at Function.Module._load (internal/modules/cjs/loader.js:598:3)

at Module.require (internal/modules/cjs/loader.js:705:19)

at require (internal/modules/cjs/helpers.js:14:16)

at Object.<anonymous> (/Users/path/myproject/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:23:26)

at Module._compile (internal/modules/cjs/loader.js:799:30)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)

at Module.load (internal/modules/cjs/loader.js:666:32)

我也遇到了同样的错误,并通过更新@angular/cli global解决了这个问题。 比如:

然后尝试创建新的应用程序,并将一些依赖项从package.json文件复制到当前项目,因为npm install不安装最新版本的软件包。然后

npm install

这解决了我的问题,但我找到了答案:

在您的package.json文件中,将devdependences中的@angular/cli版本更改为:

"@angular/cli": "7.1.0"
项目和devDependency之间存在版本不匹配。您可能使用了
npm audit fix--force
或类似的自动更新命令,这可能已经更新了“package.json”文件中的devdependency

您还可以在这里的devdependences中使用angular cli 7.3.5版。只需确保开发版本和devdependences中提到的版本是兼容的。请注意,本地anglular/cli版本在这里并不重要


更新:更改后,删除“package lock.json”并删除“node modules”文件夹。运行
npm install
再次安装模块。

所有这些对我来说都不起作用,我试图从Angular 7升级到Angular 8,以下是我的工作解决方案:

  • npm过时了
  • npm更新
  • npm安装-g npm检查
  • npm检查-u——跳过未使用的
  • 使用npm check升级除sass外的所有过期软件包
  • npm更新
  • 如果应用程序中有ViewChild,请确保将其编辑为
    @ViewChild(,{static:true})

  • 希望这将解决与安装相关的问题

    ng update @angular/cli @angular/core
    
    请尝试以下方法:
    1-ng serve
    不工作或ngcc失败只需输入:

    the project folder -- app folder -- node_modules -- @angular -- compiler-cli -- ngcc
    

    并删除ngcc锁文件。然后发球,它就会起作用。

    这里也有同样的问题。我应该在提供服务之前先安装/更新angular cli 7.1.0吗?您不必这样做。但是试试看。但一定要试试这个:删除“package lock.json”并删除“node modules”。运行“npm install”再次安装模块。devkit cli编译器cli和angular的语言服务之间是否存在依赖关系?今天我升级到angular 9,但是我找不到ngcc的任何地方,npm更新和npm审计修复应该解决这个问题/cli@latest,应该不需要运行
    卸载
    ,但这并不提供问题的答案。您可以,也可以参考页面右侧的相关和链接问题来找到答案。如果您有一个相关但不同的问题,并包含指向此问题的链接以帮助提供上下文。见:
    ng update @angular/cli @angular/core
    
    the project folder -- app folder -- node_modules -- @angular -- compiler-cli -- ngcc