I make a symfony react application with API platform but when I deploy on my hosting, I have a problem when I want to create my build (npm run build). This one blocks at 92%.
[webpack-cli] HookWebpackError: child.send is not a function
Here is the log of my error:
0 info it worked if it ends with ok
1 verbose cli [ '/opt/alt/alt-nodejs10/root/usr/bin/node',
1 verbose cli '/opt/alt/alt-nodejs10/root/usr/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle @~prebuild: @
6 info lifecycle @~build: @
7 verbose lifecycle @~build: unsafe-perm in lifecycle true
8 verbose lifecycle @~build: PATH: /opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/npm-lifecycle/node-gyp-bin:/home2/user/public_html/api/node_modules/.bin:/opt/alt/alt-nodejs10/root/usr/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/cpanel/composer/bin:/opt/alt/alt-nodejs10/root/usr/bin/:/home2/user/.local/bin:/home2/user/bin
9 verbose lifecycle @~build: CWD: /home2/user/public_html/api
10 silly lifecycle @~build: Args: [ '-c', 'encore production --progress' ]
11 silly lifecycle @~build: Returned: code: 2 signal: null
12 info lifecycle @~build: Failed to exec build script
13 verbose stack Error: @ build: `encore production --progress`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (/opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid @
15 verbose cwd /home2/user/public_html/api
16 verbose Linux 3.10.0-962.3.2.lve1.5.26.3.el7.x86_64
17 verbose argv "/opt/alt/alt-nodejs10/root/usr/bin/node" "/opt/alt/alt-nodejs10/root/usr/bin/npm" "run" "build"
18 verbose node v10.24.1
19 verbose npm v6.14.12
20 error code ELIFECYCLE
21 error errno 2
22 error @ build: `encore production --progress`
22 error Exit status 2
23 error Failed at the @ build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
this is my json
{
"devDependencies": {
"@babel/preset-react": "^7.12.13",
"@symfony/stimulus-bridge": "^2.0.0",
"@symfony/webpack-encore": "^1.0.0",
"core-js": "^3.0.0",
"regenerator-runtime": "^0.13.2",
"stimulus": "^2.0.0",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
},
"dependencies": {
"axios": "^0.21.1",
"dotenv": "^8.2.0",
"react": "^17.0.1",
"react-content-loader": "^6.0.3",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
}
}
on my pc it works well with: node v10.15.0 npm v6.9.0
thanks for your help