Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.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
Angular i18n角度,创建翻译文件时出错_Angular_Internationalization_Angular I18n - Fatal编程技术网

Angular i18n角度,创建翻译文件时出错

Angular i18n角度,创建翻译文件时出错,angular,internationalization,angular-i18n,Angular,Internationalization,Angular I18n,在我的应用程序中,所有功能都正常工作,我可以毫无错误地执行每个组件或功能,所以在终端中,就像在浏览器的开发人员控制台中一样。我尝试通过以下命令安装i18n国际化: ng xi18n --output-path src/locale 文件本身创建正确,但我看到了这个奇怪的错误 Cannot assign to read only property '_showWarnings' of object '#<Object>' TypeError: Cannot assign to rea

在我的应用程序中,所有功能都正常工作,我可以毫无错误地执行每个组件或功能,所以在终端中,就像在浏览器的开发人员控制台中一样。我尝试通过以下命令安装i18n国际化:

ng xi18n --output-path src/locale
文件本身创建正确,但我看到了这个奇怪的错误

Cannot assign to read only property '_showWarnings' of object '#<Object>'
TypeError: Cannot assign to read only property '_showWarnings' of object '#<Object>'
    at TapSubscriber._visitJsonRecursive.pipe.operators_1.tap.x [as _tapNext] (C:\Users\myname\Documents\Projekt\myProjekt\node_modules\@angular-devkit\core\src\json\schema\visitor.js:56:210)
无法分配给对象的只读属性“\u showWarnings”
TypeError:无法分配给对象“”的只读属性“\u showWarnings”
在TapSubscriber.\u visitJsonRecursive.pipe.operators\u 1.tap.x[as\u tapNext](C:\Users\myname\Documents\Projekt\myProjekt\node\u modules\@angular devkit\core\src\json\schema\visor.js:56:210)

为什么??我怎样才能修好它呢?

这也发生在我身上。在我升级包
angular devkit/buildangular
之后。在版本
0.803.2
上,它运行得非常好。由于
npm audit
警告我存在漏洞,我将此数据包更新为版本
0.803.23
。这会导致您描述的错误

我还没有找到一个合适的解决方案,但目前,以下解决方案可以解决这一问题:

删除
node\u modules
文件夹,降级数据包,运行
npm install
,运行
ng xi18n--output path src/locale
并再次将更改放到
npm shrinkwrap.json
package.json

编辑


将所有与@angular相关的软件包更新到最新的8.x版本为我解决了这个问题。

@sevic,你让我开心了一天!我不需要做整个“删除节点模块”的事情,
npm install@angular devkit/build-angular@0.803.2--save dev
是一个很好的方法,当然可以。我之所以写这些“再次删除数据包上的更改”的东西,是为了保持最新的
@angular devkit/build angular
版本:)