Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript stand

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: > https://opencollective.com/core-js > https://www.patreon.com/zloirock Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

大概意思就是core.js的问题,试了一下在babel.config.js中添加:

presets: [ [ "@vue/app", { useBuiltIns: "entry" } ] ]

运行之后报错如下:

 Error: Duplicate plugin/preset detected.
        If you'd like to use two separate instances of a plugin,
        they need separate names, e.g.

          plugins: [
            ['some-plugin', {}],
            ['some-plugin', {}, 'some unique name'],
          ]

        Duplicates detected are:
        [
          {
            "alias": "D:\\java\\SPACE\\code-space\\demodemo\\vue\\node_modules\\@vue\\cli-plugin-babel\\preset.js",
            "dirname": "D:\\java\\SPACE\\code-space\\demodemo\\vue",
            "ownPass": false,
            "file": {
              "request": "@vue/cli-plugin-babel/preset",
              "resolved": "D:\\java\\SPACE\\code-space\\demodemo\\vue\\node_modules\\@vue\\cli-plugin-babel\\preset.js"
            }
          },
          {
            "alias": "D:\\java\\SPACE\\code-space\\demodemo\\vue\\node_modules\\@vue\\babel-preset-app\\index.js",
            "dirname": "D:\\java\\SPACE\\code-space\\demodemo\\vue",
            "ownPass": false,
            "file": {
              "request": "@vue/app",
              "resolved": "D:\\java\\SPACE\\code-space\\demodemo\\vue\\node_modules\\@vue\\babel-preset-app\\index.js"
            }
          }
        ]

去掉刚刚添加在js文件的内容,启动成功了。
运行npm i element-ui -S 报错如下:

> [email protected] postinstall D:\java\SPACE\code-space\demodemo\vue\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch
":"x64"})

第一步:在package.json中添加这个对象

"optionalDependencies": {
    "fsevents": "*"
  }

第二步:删除原来安装的包和生成的package-lock.json文件

第三步:重新执行安装命令

npm install --no-optional

你可能感兴趣的:(vue,javascript)