首页 > 解决方案 > 尝试在反应应用程序客户端上构建或启动纱线时出现大问题

问题描述

我正在尝试构建一个反应应用程序,但它不再工作了,我真的不知道它是如何发生的!我真的需要你帮忙!这是尝试构建纱线后我在终端中遇到的错误:

/var/www/html/Portfolio/server/client $ yarn build
yarn run v1.12.1
warning package.json: No license field
warning Skipping preferred cache folder "/home/mint/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-999".
$ node_modules/cross-env/src/bin/cross-env.js NODE_ENV=production webpack --config config/webpack.prod.js
Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
 - options[0] misses the property 'patterns'. Should be:
   [non-empty string | object { from, to?, context?, globOptions?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
ValidationError: Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
    at validate (/var/www/html/Portfolio/server/client/node_modules/schema-utils/dist/validate.js:96:11)
    at new CopyPlugin (/var/www/html/Portfolio/server/client/node_modules/copy-webpack-plugin/dist/index.js:24:30)
    at Object.<anonymous> (/var/www/html/Portfolio/server/client/config/webpack.common.js:22:5)
    at Module._compile (/var/www/html/Portfolio/server/client/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (/var/www/html/Portfolio/server/client/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/var/www/html/Portfolio/server/client/config/webpack.prod.js:3:16)
    at Module._compile (/var/www/html/Portfolio/server/client/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (/var/www/html/Portfolio/server/client/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

标签: javascriptreactjswebpackbuild

解决方案


推荐阅读