Problem when running ng build Angular

0

Hello, I'm having an Angular problem when I run the following command for building in the ng build --prod --aot=false project directory, how do I solve the problem? What is the reason why this error is occurring? Following is the error log that occurs after executing the command.

ERROR in vendor.0963fa6ef0f8a97eaa25.bundle.js from UglifyJs
TypeError: Cannot read property '_walk' of null
    at AST_Dot.eval (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:1112:29)
    at TreeWalker._visit (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:1513:21)
    at AST_Dot._walk (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:1111:24)
    at AST_VarDef.eval (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:1058:40)
    at TreeWalker._visit (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:1513:21)
    at AST_VarDef._walk (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:1056:24)
    at AST_Var.eval (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:966:32)
    at TreeWalker._visit (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:1513:21)
    at AST_Var._walk (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:963:24)
    at walk_body (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:513:17)
    at AST_Function.eval (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:739:13)
    at TreeWalker._visit (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:1513:21)
    at AST_Function._walk (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:733:24)
    at AST_Function.walk (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:467:21)
    at get_lvalues (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:8804:34)
    at collapse (eval at <anonymous> (/home/marcelo/Desktop/Mercatorio/dashboard/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:8565:35)

Print error image:

    
asked by anonymous 06.11.2018 / 17:49

1 answer

0

The error you seem to have is related to this angular-cli link link

It says that if your project has a dependency on the tether library you have to downgrade to version 1.4.3.

Or upgrade terser to 3.10.7 version by following the steps:

  • check the current installed version of terser: npm ls terser
  • install and uninstall terser with npm install [email protected] npm uninstall terser
  • You should now see the latest version of terser at npm ls terser
06.11.2018 / 19:36