I am running into a problem with import-jdl and I am not sure why it is not working. I am trying to generate entities for microservices application.
All I get is
The jdl is being imported.
but nothing else.
I used the sample https://jhipster.github.io/jdl-studio/ entity provided by JDL without any modification.
I have tried this in my Mac, Linux (Ubuntu), and Docker container but I get the same error.
Here are the versions of the software:
JHipster Generator: v3.3.0
npm : 3.9.2
yo : 1.8.3
Microservices Application
------- Application files will be generated in folder: /Users/anand/Desktop/jhexample
JHipster update available: 3.4.0 (current: 3.3.0) Run npm install
-g generator-jhipster to update. ______________________________________________________________________________
? (1/16) Which type of application would you like to create?
Microservice application
? (2/16) What is the base name of your application? jhexample
? (3/16) As you are running in a microservice architecture, on which
port would like your server to run? It should be unique to avoid port
conflicts. 8081
? (4/16) What is your default Java package name? com.anand
? (5/16) Which type of authentication would you like to use? JWT
authentication (stateless, with a token)
? (6/16) Which type of database would you like to use? MongoDB
? (7/16) Would you like to use Maven or Gradle for building the
backend? Maven
? (8/16) Would you like to enable internationalization support? No
? (9/16) Which testing frameworks would you like to use? (Press
to select)Gatling
...snip...
Server app generated successfully.
anand$ yo jhipster:import-jdl ./jhipster-jdl.jh
The jdl is being imported.
I've faced the same situation: The jdl is being imported but nothing is generated. As Vikas Joshi suggests try using jhipster-uml:
npm install -g jhipster-uml
jhipster-uml ./jhipster-jdl.jh -db mongodb
jhispter-uml usually returns more feedback. Anyway take into account that in MongoDB as noSQL database that it is, some options have no sense (e.g relations between entities).
if you are here because your jhipster import-jdl youfile.jdl doesn't create java code for entities but reportes the entities are imported, please try
jhipster import-jdl youfile.jdl --force
I was also struggling with the same error (for MySql i.s.o MongoDB). I used jhipster-uml i.s.o jhipster:import-jdl to create Entities and it worked for me. Hope it works with MongoDB as well. Don't exactly know why it does not work with import-jdl.
I've run on the same issue on my OSX. Currently I've managed to workaround this through a virtual-machine on linux(debian/ubuntu) using the jhipster-generator version 3.4.0 . Newer version will not create the entities even for me.
Please try to delete all stuff installed from bottom to top from the instalation guide here until nodejs part.
So yo will done the following:
npm uninstall -g generator-jhipster
npm uninstall -g gulp
npm uninstall -g bower
npm uninstall -g yo
Then follow steps to remove nodejs from here
After uninstalling start again installing nodejs and commponents as suggested on jhipster guide with the only difference at the last step:
npm install -g generator-jhipster#3.4.0
Related
Problem
I was facing difficulty in importing one of the packages properly and using it in my MERN application in the backend. After researching and looking at the deployed code I got to know that my application is using the unwanted version of that package and thus it is causing the issue but I already changed the version in package.json before pushing. I have written unwanted here because in my case the new version of the package has bugs and that's why I want the old/previous version back but I am unable to know the exact reason or thing which is causing heroku to use the unwanted version again and again.
For Clarity:
initial version: 1.6.6 (was working fine)
then I installed version: 1.7.0 (found bugs) unwanted version
tried to go back to version: 1.6.6 but couldn't
What I have tried
The first thing I tried was setting NODE_MODULES_CACHE to false to avoid heroku from picking up old code as it has worked for me in the past. Apart from that I have I can't find any other thing.
There is nothing suspicious in the heroku logs and it builds the application without any error.
I found the solution to it if someone's looking for it. It is not much of a solution instead it's more about how heroku works.
Heroku uses npm ci instead of npm install.
npm ci installs all dependencies in respect to package-lock.json similar to npm install. The key difference here is that ci doesn't alter package-lock.json under any circumstances.
So basically, the package-lock.json was still the unwanted one in my case and heroku was installing that rather than what I pushed into package.json as it didn't matter.
So, in order to solve this issue you have two options:
You can push your updated package-lock.json. In my case I had intentionally not added package-lock.json to versioning as I thought heroku would update it so I had put it in .gitignore
You can set the USE_NPM_INSTALL environment variable to true to let Heroku know that you want to use npm install instead of npm ci to create the build environment. (NOTE: If you want to use npm install Heroku advises to use NODE_MODULES_CACHE=false as it speeds up the build time)
I went with option 1.
Link to Heroku docs: https://devcenter.heroku.com/articles/nodejs-support
I had this issue before with some app (N 4.1).
Now i'm doing another app, and i have the same issue :
First, im preparing build:
tns build ios --for-device --release --provision MY_Provision
Nativescript is doing build, so next i'm opening it in XCode, and doing some twaks like version number etc...
Lastly i'm doing "Archieve" and trying to Validate this archieve.
The result is error, in the previous app written in N 4.1 i had the same but with another plugin, and now validation throws: Invalid build structure - binary app/rns_modules.fstevents.lib/binding/Release/FILE NAME.
many errors regarding this folder.
So i've just removed this directory and done another archieve and validation - app passed the validation.
So, my question is - do i need such number of plugins in tns_modules ?
Or better question - is there any way to determine what is not needed ?
Or, am i doing something wrong when building an app ? As seems massive number of directories here and i'm wondering if maybe there is some kind of cleanup or something ?
For now, the only way to store an app is to validate first, check what is blocking validation, delete this, check if app works (:() and try again.
Thank you.
Below, attached, folder that is blocking validation and amount of dirs inside of tns_modules.
pacakge.json:
NativeScript CLI will prepare (i.e. copy) all packages declared in the dependencies section of your package.json (and their dependencies) in tns_modules. All devDependencies and their dependencies will not be copied to the native Xcode/Android Studio project.
So, all packages that are required only for building the application, should be installed as devDependencies. For example, such packages are nativescript-dev-webpack, nativescript-dev-typescript, etc.
Also, it looks like you have installed NativeScript CLI as a dependency of your project. By default, it should be installed globally, i.e. npm i -g nativescript. In case you omit the -g flag, npm will install it as dependency of your project.
You can try:
rm -rf platforms
npm un --save nativescript
Check package.json for other packages with -dev in their names and ensure they are in the devDependencies section.
After that run tns build ios --forDevice.
I follow and try same sample code in this instruction
Playground tutorial
but when I submit a transaction Error: Could not find any functions to execute for transaction org.acme.mynetwork.Trade#d77dbd2d-53e3-4435-b4fb-d802d5bd6bec.
Anyone have any idea?
This may have been an error you saw in Playground in v0.14.3. Suggest to update (ie re-install) your Composer dev environment to the current release v0.15.0 (as of Nov 10th) - there is a new tutorial (its changed from what you saw) and it will use Business network cards for the network deploy (createComposerProfile.sh is no longer needed) - makes life easier. To get the latest version, you will need to install the modules as per the docs -> https://hyperledger.github.io/composer/installing/development-tools.html - this will get the latest release. Make sure you do a full teardown using the scripts you downloaded in fabric-tools (as your CC containers will be 0.14.3 or earlier and thus out of date) and that you then subsequently, do an npm -g uninstall of the same module names eg composer-cli, composer-playground etc and such that they are all at the same level (0.15.0) upon subsequent npm -g install of same composer modules.
I use nodejs and mongoose to save document to mongodb in windows in development, but I fail to connect to mongodb. My nodeunit test is always being blocked to the line mongoose.connect().
I found mongoose use node-mongodb-native. My question is:
Do I need to do some special instructions to install node-mongodb-native in windows 7 (64-bit)?
How to install node-mongodb-native in windows?
Mongoose has a dependency on the npm package monogodb.
If you look at the npm page for mongodb here, https://npmjs.org/package/mongodb, you'll find the homepage form the package is http://mongodb.github.com/node-mongodb-native/
That page is node-mongodb-native.
So, there's nothing you need to do special to get it, as doing
npm install mongoose
is enough to install the native package.
So, I got a small site started in node.js (my first one) using Express. Pretty happy with it, until I tried to deploy to Heroku and found that I had 0.4.9 installed and they only support 0.4.7.
Is uninstalling 0.4.9 and installing 0.4.7 my only option, or is there a way to do a side-by-side on the two?
You can override the version of node.js and npm by customizing the Heroku build pack:
http://blog.superpat.com/2011/11/15/running-your-own-node-js-version-on-heroku/
Actually...you do not have to remove anything.
Just ensure you are using features of node compliant with node 0.4.7 and when you make your package.json which specifies your dependencies has the correct version number or range specified.
I had a similar issue where one of our developers made is packacge and set the dependency to node 0.4.8 however it didn't require this it was just what version he was using at the time, we ended up updating his package.json to list node 0.4.7 instead and then my package which depended on his deployed to heroku just fine.
It seems Heroku only supports 0.4.7 at the moment and even suggests to develop strictly on that version.
If you have to use heroku then you have to uninstall 0.4.9, install 0.4.7.
If you don't have to use heroku. You can always setup a VPS yourself, and you will have the freedom to install whatever version that pleases you. :D