5

I have an Vuejs App using promise but get this error : This dependency was not found: core-js/fn/promise in ./src/store/index.js To install it, you can run: npm install --save core-js/fn/promise my package.json:

"dependencies": {
    "axios": "^0.21.1",
    "bootstrap": "^4.5.3",
    "core-js": "^3.6.5",
    "jquery": "^3.5.1",
    "popper.js": "^1.16.1",
    "vue": "^2.6.11",
    "vue-axios": "^3.2.2",
    "vue-router": "^3.2.0",
    "vuex": "^3.4.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-plugin-vuex": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/eslint-config-standard": "^5.1.2",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.0",
    "eslint-plugin-vue": "^6.2.2",
    "vue-template-compiler": "^2.6.11"
  },

I run the command npm install --save core-js/fn/promise ,but nothing change

Sermed mayi
  • 697
  • 7
  • 26

4 Answers4

16

I have the same err today, reason is import { reject } from "core-js/fn/promise", I delete it then app compiled successfully.

kingZ
  • 176
  • 1
  • 3
2

Try update your core-js dependency version by:

npm install core-js
// or
yarn add core-js

The error is a result of yourProject/node_modules/core-js is not sync with your code.

You're importing core-js/fn/promise, but the build tool not found it.

Junior Tour
  • 439
  • 7
  • 8
1

I had a similar problem with core-js when I tried to start a Vue app, this was the error:

core-js/modules/es6.array.find in ./src/state/helpers.js,
* core-js/modules/es6.function.name in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-link.vue?vue&type=script&lang=js&, ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-icon.vue?vue&type=script&lang=js& and 4 others
...
..
..

my fix was to update dependencies and my package.json after the update is the next:

{
 ...
 "dependencies": {
  "core-js": "^2.6.12",
  "vue": "2.5.16"
 },
 "devDependencies": {
  "@babel/core": "^7.14.6",
 }
}
CrgioPeca88
  • 973
  • 7
  • 12
-3

Do the following steps:

npm install name dependency,
npm install

It's perfectly running for me.

Skatox
  • 4,237
  • 12
  • 42
  • 47