I'm using jhipster-uml and I'm getting errors with date types used
First, I had
C:\Users\jb\hips\h4>jhipster-uml socle2.uml
Parser detected: VISUAL PARADIGM.
The type 'Org.joda.time.DateTime' isn't supported by JHipster, exiting now.
Error
at Object.<anonymous> (C:\Users\jb\AppData\Roaming\npm\node_module
s\jhipster-uml\lib\exceptions\invalid_type_exception.js:7:34)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\jb\AppData\Roaming\npm\node_module
s\jhipster-uml\lib\editors\modelio_parser.js:6:28)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)
Changed to java.time.ZonedDateTime, same result
The type 'Java.time.ZonedDateTime' isn't supported by JHipster, exiting now.
Notice the upper char at start of package (no upper char in generated uml)
Context:
W764, uml file used is xmi export (UML2 w/ primitive UML types exported) of diagram creating through reversing .java sources, by visual paradigm 12.2 CE upped to standard edition)
In case you get this message or similar when generating with JHipster-UML:
Only use JHipster supported types, do not use inheritance nor generics
Related
I am trying to get a simple Kafka consumer up and running on Heroku. I am using Node 8.11 and node-rdkafka. I have it running locally. When I try to run it on Heroku, I get this error:
Error: librdkafka++.so.1: cannot open shared object file: No such file or
directory
at Object.Module._extensions..node (module.js:681:18)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at bindings (/app/node_modules/bindings/bindings.js:81:44)
at Object.<anonymous> (/app/node_modules/node-rdkafka/librdkafka.js:10:32)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
I know the library is a wrapper for librdkafka and it looks like it just can't find it. According to the list of things preinstalled on Heroku Ubuntu instance, it looks like librdkafka-dev and librdkafka1 are installed. I don't know how to use those, or if something else is going on.
You have to use the Confluent librdkafka package.
Add this to your Aptfile:
:repo:deb [arch=amd64] http://packages.confluent.io/deb/4.0 stable main
Still having issues after doing this, but they are different issues and it looks like I'm closer.
I'm hosting a NodeJs web app in Microsoft Azure, and I'm receiving the following error:
Sun Mar 25 2018 01:32:14 GMT+0000 (Coordinated Universal Time): Application has thrown an uncaught exception and is terminated: SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (D:\home\site\wwwroot\server\helpers\email.js:1:77)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (D:\home\site\wwwroot\server\controllers\email.js:2:13)
at Module._compile (module.js:409:26)
at the error line:
var Mailgun = require('mailgun-js');
The same application is working properly in another Azure Web App (same config between the two).
To setup the NodeJs version I'm using across all the web apps the WEBSITE_NODE_DEFAULT_VERSION application setting.
I would expect this kind of error with older versions of nodejs, but not with the 8.10.
Any idea?
I just found that the web application with problems was created using a Microsoft template "Node JS Empty Web App".
This template left on the root of the web application the iisnode.yml file that was forcing the version 4.2.4, despite globally was used the 8.10.0.
nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\4.2.4\node.exe"
Removing the iisnode.yml solved the issue.
As mentioned by redeyes.
another approach is to edit the path with the version number
nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\8.10.x\node.exe"
I am trying to get a particular npm package to run on Ubuntu 16.04. I am currently running the most up-to-date versions of nodejs and npm, as well as the package (turndown).
Here is the error that I get:
root#ubuntu-s-1vcpu-1gb-nyc1-01:/usr/server# nodejs index.js
/usr/server/node_modules/jsdom/lib/api.js:10
const { URL } = require("whatwg-url");
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at createHTMLParser (/usr/server/node_modules/turndown/lib/turndown.cjs.js:529:17)
at Object.<anonymous> (/usr/server/node_modules/turndown/lib/turndown.cjs.js:537:60)
at Module._compile (module.js:410:26)
The error states it occurs within the "turndown" package and is due to the language in the constructor. What is confusing to me is that this runs on Fedora 27 without error.
What could be causing the difference in behavior?
The answer to this question was to update my version of NodeJS. I ran into another error now, but it is package related.
I am trying to convert MS Word files (.docx/.doc) to *.pdf file but didn't find any .net core package to do so.
Then I thought to use Node.js package for the same and to run it inside my .Net Core app. I tried node-msoffice-pdf node package. I first created a sample Node app just to test if this package works but when I run it, I get following error:
D:\Projects\test\node_modules\edge\lib\edge.js:169
return edge.initializeClrFunc(options);
^
Error: Unable to compile C# code.
----> Errors when compiling as a CLR library:
error CS0006: Metadata file 'C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Word\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll
' could not be found
error CS0006: Metadata file 'C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.d
ll' could not be found
error CS0006: Metadata file 'C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.PowerPoint\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Po
werPoint.dll' could not be found
error CS0006: Metadata file 'C:\Windows\assembly\GAC_MSIL\Office\15.0.0.0__71e9bce111e9429c\Office.dll' could not be found
error CS0006: Metadata file 'C:\Windows\assembly\GAC_MSIL\Microsoft.Vbe.Interop\15.0.0.0__71e9bce111e9429c\Microsoft.Vbe.Interop.dll' could not be f
ound
----> Errors when compiling as a CLR async lambda expression:
error CS0006: Metadata file 'C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Word\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll
' could not be found
error CS0006: Metadata file 'C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.d
ll' could not be found
error CS0006: Metadata file 'C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.PowerPoint\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Po
werPoint.dll' could not be found
error CS0006: Metadata file 'C:\Windows\assembly\GAC_MSIL\Office\15.0.0.0__71e9bce111e9429c\Office.dll' could not be found
error CS0006: Metadata file 'C:\Windows\assembly\GAC_MSIL\Microsoft.Vbe.Interop\15.0.0.0__71e9bce111e9429c\Microsoft.Vbe.Interop.dll' could not be f
ound
at Error (native)
at Object.exports.func (D:\Projects\test\node_modules\edge\lib\edge.js:169:17)
at Object.<anonymous> (D:\Projects\test\node_modules\node-msoffice-pdf\lib.js:4:23)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (D:\Projects\test\server\api\todo\controller\todo-controller.js:3:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (D:\Projects\test\server\api\todo\route\todo-route.js:3:25)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
What's the best way to convert MS Word files to PDF in .Net Core?
This Node.js package doesn't work for the same reason that the .NET Core one doesn't: it's calling Microsoft.Office.Interop, and that only works on Windows machines with the Office interop stuff installed.
Basically, when .NET Core compiles it knows that Microsoft.Office.Interop might not be available when it's installed, so throws an error then. However JS isn't compiled and finds out at run-time that it's installed on a server/container where C:\Windows\assembly\GAC_MSIL\... just isn't there.
Wrapping a Node.js app in your .NET Core just moves this problem from compile-time to run-time.
I was settings up a new system to use CodeceptJS and have hit an issue. I followed these notes, but just get an error when trying to run codeceptjs. The error is...
codeceptjs
/usr/local/lib/node_modules/codeceptjs-webdriverio/node_modules/codeceptjs/lib/mocha_factory.js:6
let mocha;
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/codeceptjs-webdriverio/node_modules/codeceptjs/lib/container.js:5:20)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
My node.js and npm is installed globally via normal apt-get and npm -g
System info...
Ubuntu 17.04 x86_64
nodejs: 4.7.2
npm: 4.5.0
bash 4.4.5
Does anyone know the cause of this issue or how to get around it?
Just as an update, thanks to artem for the note on 'use strict'; I added that to the top of node_modules/codeceptjs/lib/mocha_factory.js and that, I think, got me past the initial problem. However I now seem to be hitting an issue in node_modules/codeceptjs/lib/output.js. The error is...
codeceptjs
/usr/local/lib/node_modules/codeceptjs-nightmare/node_modules/codeceptjs/lib/output.js:139
function print(...msg) {
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/codeceptjs-nightmare/node_modules/codeceptjs/lib/event.js:3:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
...I've tried a few things to resolve this, adjusting the print function there, but with no luck yet.
This seems to be the same with the codeceptjs-nightmare and codeceptjs-webdriverio meta-packages.
I'd be grateful of any ideas, suggestions or alternatives anyone has.
Your second issue is because of an outdated Node version. The spread operator (the ... error that you're seeing) is supported in Node 5.12.0 and later: http://node.green/#ES2015-syntax-spread-------operator
I'm not sure what the best way for you to upgrade is with Ubuntu, but that should solve your issue.