>PROBLEM
>SOLUTION
Detailed procedure here:
>ENV
Docker
Angular 7..13
Node.js 12..16
- After the following procedure:
ng new myproject
npm install rxjs
npm audit fix --force
ng serve
- The angular application fails to start returning the following message:
An unhandled exception occurred: require() of ES Module node_modules/@angular/compiler-cli/bundles/index.js
/data/prj/node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js not supported.
Instead change the require of index.js in
/data/prj/node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js to a dynamic
import() which is available in all CommonJS modules.
See "/tmp/ng-Fe4Op7/angular-errors.log" for further details.
Avoid using --force argument with "npm audit" with this versions (detailed below under ENV topic) until the bug is fixed.
Use just:
npm audit fix
>ENV
Windows 10
Angular CLI: 13.1.2
Node: 16.13.1
Package Manager: npm 8.1.2
OS: win32 x64
Attempt to run a mvn command, for instance:
mvn -version
Returns:
<!--Could not find or load main class ...
Caused by: java.lang.ClassNotFoundException: ...-->
Check your envvars (environment variables).
The configuration shall be something like this:
M2_HOME = C:\apache-maven
MAVEN_OPTS=-Xms256m -Xmx512m
Path=%Path%;%M2_HOME%\bin
For some mistake, you may have a misconfiguration. For example:
***WRONG:
MAVEN_OPTS=-%M2_HOME%\bin
Windows 10
apache-maven
Angular project fails starting and returns the following error message:
Cannot parse arguments. See below for the reasons.
Argument --ssl could not be parsed using value "true\r".Valid type(s) is: boolean
It happens when a project using Windows encoding is deploy on *nix environment due the carriage return (CR) differences.
Convert the CRs to unix format.
There are many ways of doing that:
1. If using Git, when it is installed, during its install wizard, there are options to set automatically de CR format.
2. Free apps like SciTE, Notepad++, VSCode and etc. have encoding and CR converters.
windows 10
angular
@CTL:
y;faq-Cannot parse arguments. See below for the reasons. Argument --ssl could not be parsed using value "true\r".Valid type(s) is: boolean<memo<angular;.
Attempt to access an Angular project running from a docker fails, returning on the browser "ERR_EMPTY_RESPONSE".
Add --host argument to the "ng serve" command to start the service.
- before:
ng serve --port 4400 --ssl true
- after:
ng serve --port 4400 --ssl true --host 0.0.0.0
also tested OK with:
ng serve --port 4400 --ssl true --host=0.0.0.0
windows 10
angular 16
tipsfordev.com/localhost-didn-t-send-data-err-empty-response-and-curl-52-empty-reply-from-server
@CTL:
y;faq-angular: ERR_EMPTY_RESPONSE<memo<docker;.
Attempt to map a volume fails retuning:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "-v": executable file not found in $PATH: unknown.
WRONG:
docker run -it --name extodo alsdias/express_todo -v C:\data:/home
RIGHT:
docker run -it --name extodo -v C:\data:/home alsdias/express_todo
w10
docker
>PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...