2
Hello, I’m having trouble in Angular when I run the following command to building in the project directory ng build --prod --aot=false
, how do I fix the problem? What and why is this error occurring?
Below is the log of the error 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)
Try running the npm install --update-binaries --noshrinkwrap command Something else update your angular cli version
– Diogo Santos Almeida
Which command to update angular cli
– Marcelo Henrique Dos Reis
npm install -g @angular/cli@latest
– Diogo Santos Almeida
And one more question the command you want to run to build the right way is this ng build --no-Aot --Prod
– Diogo Santos Almeida
I’m having trouble upgrading the angular cli,
npm ERR! path /usr/lib/node_modules/@angular/cli
...– Marcelo Henrique Dos Reis
If you are in windows try to run this command as administrator
– Diogo Santos Almeida
I’m on Linux, when I give a sudo before, he says it all worked out but the cli version of angular permance unchanged
– Marcelo Henrique Dos Reis
Then do the following, remove the angular cli and then install a new version npm remove @angular/cli -g npm cache clean npm i @angular/cli -
– Diogo Santos Almeida
how do I remove?
– Marcelo Henrique Dos Reis
npm remove @angular/cli -g
– Diogo Santos Almeida
I removed and reinstalled the angular cli and changed nothing :/
– Marcelo Henrique Dos Reis