“在'@ angular/platform-b​​rowser'中找不到导出'DOCUMENT' [英] "export 'DOCUMENT' was not found in '@angular/platform-browser'

查看:197
本文介绍了“在'@ angular/platform-b​​rowser'中找不到导出'DOCUMENT'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试将IONIC应用程序从版本3升级到版本4时发生

Happened while trying to upgrade IONIC app from version 3 to 4

将所有插件和模块更新为最新版本,没有任何运气.

Updated all plugins and modules to latest available, without any luck.

ERROR in ./node_modules/ionic-angular/components/app/app.js 24:35-43
"export 'DOCUMENT' was not found in '@angular/platform-browser'
ERROR in ./node_modules/ionic-angular/module.js 195:71-79
"export 'DOCUMENT' was not found in '@angular/platform-browser'
[ERROR] An error occurred while running subprocess ng.

这是我的离子信息

Ionic info:
Ionic:

   Ionic CLI                     : 5.1.0 (C:\Users\Acer\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.6.0
   @angular-devkit/build-angular : 0.800.6
   @angular-devkit/schematics    : 8.0.6
   @angular/cli                  : 8.0.6
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res : 0.5.1
   native-run  : 0.2.6

System:

   Android SDK Tools : 26.1.1 (C:\Users\Acer\AppData\Local\Android\sdk)
   NodeJS            : v10.11.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.9.2
   OS                : Windows 10

不胜感激,有人可能会有所帮助.

would appreciate, somebody could be helpful.

推荐答案

文档已从@ angular/platform-b​​rowser中删除如果您从@ angular/platform-b​​rowser中使用DOCUMENT,则应从@ angular/common中导入

DOCUMENT is removed from @angular/platform-browser If you use DOCUMENT from @angular/platform-browser, you should start to import this from @angular/common.

直到回购将其修复,您可以按照以下步骤为您修复它...

until the repo gets it fixed, you can do as below to fix it for you...

IN

\ node_modules \ ionic-angular \ components \ app \ app.js

\node_modules\ionic-angular\components\app\app.js

替换

import { DOCUMENT, Title } from '@angular/platform-browser';

使用

import { DOCUMENT } from '@angular/common';
import { Title } from '@angular/platform-browser';

然后输入

\ node_modules \ ionic-angular \ module.js

\node_modules\ionic-angular\module.js

替换

import { DOCUMENT, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';

使用

import { DOCUMENT } from '@angular/common';
import { HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';

这篇关于“在'@ angular/platform-b​​rowser'中找不到导出'DOCUMENT'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆