您当前的位置: 首页 >  vue.js

彭世瑜

暂无认证

  • 3浏览

    0关注

    2791博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

vue.js:node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/object/assign.js

彭世瑜 发布时间:2022-09-01 14:51:27 ,浏览量:3

我的项目依赖

package.json

{
  "dependencies": {
    "element-ui": "2.15.1",
    "vue": "2.6.10",
  },
  "devDependencies": {
    "@vue/cli": "4.5.19",
    "@vue/cli-service-global": "4.5.19"
  }
}

运行单文件开发

$ npx vue serve

报错

ERROR  Failed to compile with 3 errors                                      2:32:02 PM

These dependencies were not found:

* core-js/library/fn/object/assign 
in ./node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/object/assign.js
* core-js/library/fn/symbol 
in ./node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/symbol.js
* core-js/library/fn/symbol/iterator 
in ./node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/symbol/iterator.js

To install them, you can run: npm install --save 
core-js/library/fn/object/assign 
core-js/library/fn/symbol 
core-js/library/fn/symbol/iterator

解决办法

npm install core-js@3 --save
npm install async-validator@1.11.5 --save
npm i -D babel-plugin-component

配置 .babelrc

{
  "presets": [
    [
      "@babel/preset-env", 
      {
        "useBuiltIns": "usage",
        "corejs": 3 
      }
    ]
  ],
  "plugins": [
    [ "component",
      {
      "libraryName": "element-ui",
      "styleLibraryName": "theme-chalk"
      }
      ]
  ] 
}

参考 elementUI报错找不到依赖 core-js/library/fn/object/assign in ./node_modules/babel-runtime/core-js/object/ass

关注
打赏
1665367115
查看更多评论
立即登录/注册

微信扫码登录

0.1680s