У меня ошибка при запуске yarn build
. Я попробовал то, что @khelkun предложил здесь , но у меня это не работает. Я также пытался отредактировать autobind-decorator
в 2.1.1
, но это также не работает.
$ yarn build
yarn run v1.12.3
$ node scripts/build.js
> myapp@0.1.0 build /path/myapp/client
> react-scripts build
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/autobind-decorator/src/index.js:7
Read more here: // SOF doesn't let me paste the shortened link but it goes to: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myapp@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myapp@0.1.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! /path/.npm/_logs/2018-11-15T22_23_20_735Z-debug.log
✨ Done in 11.02s.
Вот мой package.json
:
"scripts": {
"server": "node server.js",
"client": "node scripts/start-client.js",
"start": "concurrently \"nodemon server.js\" \"npm run client\"",
"build": "node scripts/build.js"
},
Мои build.js
и start-client.js
внутри ./scripts
:
// build.js
const args = ["run build"];
const opts = { stdio: "inherit", cwd: "client", shell: true };
require("child_process").spawn("npm", args, opts);
// start-client.js
const args = ["start"];
const opts = { stdio: "inherit", cwd: "client", shell: true };
require("child_process").spawn("npm", args, opts);