I have tried and read all issues about this problem but I couldn't solve it.
My angular 4 program compiles successfully in windows but there are errors serving it in Ubuntu. And ng build --prob doesn't work on Ubuntu or Windows. This is a screenshot of the error I get when compiling. Can anyone help?
As I can see the issue is not in compilation -- but in finding the files that are mentioned and to be fetched.
Ubuntu (Linux) and Windows have different sets of instructions and ways of traversing the file.
For Example: in Windows in cmd window cd c: will work, in Ubuntu c:/ works.
My suggestion is make new project in Ubuntu and kindly understand how the files are being fetched and 'URL' correction needs to be done in individual files (though this is also strange).
Your project is running properly in windows and opening without errors (if it really is) -- shows there is nothing wrong with your Angular-Code, npm, angular-cli pakcage or NodeJs.
Just, for precaution -- delete Node, NPM and Angular-CLI and remove them from ubuntu and take a fresh install of all 3 -- NodeJS, NPM, Angular-CLI. Sometimes, some strange errors happen due to versions of Node and NPM not up-to-date. (And, you are now compiling your project on new computer -- means the versions of Node/NPM/Angular-CLI might not be the same as in your previous windows computer). So, why take risk. Just remove from new system and re-install these 3 dependencies ... and ping back ... what happens!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With