簡體   English   中英

找不到模塊“ babel-core”,但已安裝@ babel / core

[英]Cannot find module 'babel-core' but @babel/core is installed

運行jest測試后,其中之一正在收到此錯誤。

Cannot find module 'babel-core'

      at Object.<anonymous> (node_modules/vue-jest/lib/compilers/babel-compiler.js:1:15)

這很簡單。 未安裝babel-core。 但是會安裝更新版本的babel-core(@ babel / core)!

在這里我添加了我的package.json devDependencies

"devDependencies": {
    "@babel/core": "^7.4.5",
    "@babel/preset-env": "^7.4.5",
    "@babel/runtime": "^7.4.4",
    "@vue/cli-plugin-babel": "^3.7.0",
    "@vue/cli-plugin-eslint": "^3.7.0",
    "@vue/cli-plugin-pwa": "^3.7.0",
    "@vue/cli-service": "^3.7.0",
    "@vue/test-utils": "^1.0.0-beta.29",
    "axios-mock-adapter": "^1.16.0",
    "babel-eslint": "^10.0.1",
    "babel-loader": "^8.0.6",
    "babel-preset-env": "^1.7.0",
    "bootstrap": "^4.3.1",
    "eslint": "^5.8.0",
    "eslint-plugin-vue": "^5.0.0",
    "gulp-babel": "^8.0.0",
    "jest": "^24.8.0",
    "jest-serializer-vue": "^2.0.2",
    "jest-transform-stub": "^2.0.0",
    "jest-watch-typeahead": "^0.3.1",
    "json-loader": "^0.5.7",
    "less-loader": "^4.1.0",
    "postcss-flexbugs-fixes": "^4.1.0",
    "postcss-loader": "^3.0.0",
    "raw-loader": "^2.0.0",
    "sw-precache-webpack-plugin": "^0.11.5",
    "vue-jest": "^3.0.4",
    "vue-loader": "^15.7.0",
    "vue-template-compiler": "^2.5.21",
    "webpack": "^4.32.0",
    "webpack-cli": "^3.3.2"
  },

我想知道如何使我的babel加載程序或笑話識別@ babel / core而不是babel-core。 我讀到babel-loader 8+應該可以完成工作,但是它沒有按預期工作。

不知道這是一個開玩笑的問題,但是謝謝。

babel-core不是@babel/core它們是不同的軟件包。

您應該可以通過這里逃脫

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM