首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试导入错误:运行ionic serve时,未从‘ionic icons/icons’中导出'reorder‘

尝试导入错误:运行ionic serve时,未从‘ionic icons/icons’中导出'reorder‘
EN

Stack Overflow用户
提问于 2020-03-25 16:50:40
回答 1查看 493关注 0票数 0

每次运行命令ionic serve时,我都会遇到错误。我已经尝试删除node_modules并使用yarn重新安装所有包,但这个问题仍然存在。

下面是错误

代码语言:javascript
复制
Failed to compile

./node_modules/@ionic/react/dist/index.esm.js
Attempted import error: 'reorder' is not exported from 'ionicons/icons'.

This error occurred during the build time and cannot be dismissed.

这是我的package.json

代码语言:javascript
复制
{
  "name": "XXXXXXXXXX",
  "version": "0.0.1",
  "private": true,
  "dependencies": {
    "@capacitor/android": "^1.3.0",
    "@capacitor/core": "1.3.0",
    "@capacitor/ios": "^1.3.0",
    "@ionic-native/core": "^5.19.0",
    "@ionic-native/http": "^5.19.0",
    "@ionic-native/image-picker": "^5.19.1",
    "@ionic-native/in-app-browser": "^5.19.0",
    "@ionic-native/in-app-purchase": "^5.23.0",
    "@ionic-native/in-app-purchase-2": "^5.21.6",
    "@ionic-native/screen-orientation": "^5.20.0",
    "@ionic-native/sqlite": "^5.20.0",
    "@ionic/react": "^4.11.10",
    "@ionic/react-router": "^4.11.7",
    "@types/jest": "^24.0.18",
    "@types/node": "^12.7.12",
    "@types/react": "^16.9.5",
    "@types/react-dom": "^16.9.1",
    "@types/react-router": "^5.1.1",
    "@types/react-router-dom": "^5.1.0",
    "cc.fovea.cordova.purchase": "^8.1.1",
    "chart.js": "^2.9.3",
    "cordova-plugin-advanced-http": "^2.3.1",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-inappbrowser": "^3.1.0",
    "cordova-plugin-inapppurchase": "^1.2.0",
    "cordova-plugin-screen-orientation": "^3.0.2",
    "cordova-plugin-telerik-imagepicker": "^2.3.3",
    "cordova-sqlite-storage": "^4.0.0",
    "es6-promise-plugin": "^4.2.2",
    "ionic-native": "^2.9.0",
    "ionicons": "^5.0.1",
    "react": "^16.10.2",
    "react-chartjs-2": "^2.8.0",
    "react-click-n-hold": "^1.0.7",
    "react-dom": "^16.10.2",
    "react-router": "^5.1.0",
    "react-router-dom": "^5.1.0",
    "react-shimmer": "^2.0.1",
    "typescript": "3.6.3"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "description": "An Ionic project",
  "devDependencies": {
    "@capacitor/cli": "1.3.0",
    "react-scripts": "^3.4.0"
  }
}

由于这个错误,我无法在浏览器上运行我的ionic应用程序。这会影响调试和测试代码所需的工作时间,因为我需要一直构建到本机代码。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-03-25 16:59:05

通过删除离子图标包解决了这个问题。尝试运行

代码语言:javascript
复制
npm uninstall ionicons

代码语言:javascript
复制
yarn remove ionicons
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60845475

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档