I literally just made a fresh installation of the Angular CLI in order to try it out and I don\'t have a clue on what\'s causing the following error on the command line:
Try this command -> npm install copy-webpack-plugin@4.3.0 resolved my issue
run this command npm install copy-webpack-plugin@4.3.0
if npm install copy-webpack-plugin@4.3.1 doesn`t help try add in package.json:
"optionalDependencies": { "copy-webpack-plugin": "4.3.1" }, "resolutions": { "copy-webpack-plugin": "4.3.1" }
callbacks[i](err, result); ^
TypeError: callbacks[i] is not a function
solution:- npm install copy-webpack-plugin@4.3.0
Try to uninstall and reinstall Angular CLI :
Global package:
npm uninstall -g @angular/cli
npm cache clean
if npm version is > 5 then use
npm cache verifyto avoid errors (or to avoid using --force)
npm install -g @angular/cli@latest
Local project package:
rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell
npm install --save-dev @angular/cli@latest
npm install
EDIT: The issue is now fixed, so there is no need to use this workaround anymore.
Solution (workaround) found here
Add "copy-webpack-plugin": "4.3.0"
to your package.json
Thanks @neshkatrapati