鍍金池/ 問答/數(shù)據(jù)庫  HTML/ vue 打包報錯throw new _ValidationError2.defa

vue 打包報錯throw new _ValidationError2.default(ajv.errors, name);

E:\yunnan\public\wap>npm run build
> vue_chaguan@1.0.0 build E:\yunnan\public\wap
> node build/build.js
E:\yunnan\public\wap\node_modules\schema-utils\dist\validateOptions.js:40
    throw new _ValidationError2.default(ajv.errors, name);
    ^
false
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue_chaguan@1.0.0 build: `node build/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue_chaguan@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-06-08T03_29_13_930Z-debug.log
回答
編輯回答
乖乖瀦

把build文件里面的utils.js的publicpath:'../../'給屏蔽掉就不報錯了。


function generateLoaders (loader, loaderOptions) {
    const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
    if (loader) {
      loaders.push({
        loader: loader + '-loader',
        options: Object.assign({}, loaderOptions, {
          sourceMap: options.sourceMap
        })
      })
    }

    // Extract CSS when that option is specified
    // (which is the case during production build)
    if (options.extract) {
      return ExtractTextPlugin.extract({
        use: loaders,
        fallback: 'vue-style-loader',
        //publicpath:'../../',
      })
    } else {
      return ['vue-style-loader'].concat(loaders)
    }
  }
2017年1月16日 16:04