Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ENOENT: no such file or directory, open 'XXXXX\server\src\config/application-d.yml' #96

Closed
ajoysinhaabbvie opened this issue Jan 17, 2020 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers more information is needed More information are required to understand issue
Milestone

Comments

@ajoysinhaabbvie
Copy link

Describe the bug
After creation of nodebased microservice using jhipster import-jdl model-name.jdl --blueprints nodejs, on start of server "npm start" application is looking for a file name application-d.yml. where as application-dev.yml

To Reproduce
Steps to reproduce the behavior:

  1. Create a nodejs app using jhipster import-jdl model-name.jdl --blueprints nodejs
  2. go into server folder
  3. run npm install
  4. run npm start

Application is giving error as below
[nodemon] starting ts-node src/main.ts
Error: ENOENT: no such file or directory, open 'D:\microservices\services\usermicroservice\server\src\config/application-d.yml'

Expected behavior
application should start

Note : if you change the application-dev.yml into application-d.yml, then application is starting smoothly

@ghost
Copy link

ghost commented Jan 17, 2020

Hi @ajoysinhaabbvie,
thanks to use NHipster.. every feedback is very important.
So, could you explain what version of blueprint are you using?
The last release passed every integration test that covers your use case: https://github.com/jhipster/generator-jhipster-nodejs/runs/384846320

@ghost ghost added good first issue Good for newcomers more information is needed More information are required to understand issue labels Jan 17, 2020
@ajoysinhaabbvie
Copy link
Author

I am using : [email protected]
I have created nodejs microservice app from jdl file. and then run the application server.
attaching the screenshots for your reference .. hope this will help ..

If i do rename application-dev.yml to application-d.yml then system is working .

screenshot1
screenshot2

@ajoysinhaabbvie
Copy link
Author

ajoysinhaabbvie commented Jan 22, 2020

Attaching jdl file for your reference
Please change name from .txt to .jdl

app.jdl.txt

@ghost
Copy link

ghost commented Jan 22, 2020

Maybe I have understand your problem.. Can you check what is the value of the node system variable NODE_ENV? It is used in the app starting:

const envYamlConfig = yaml.safeLoad(fs.readFileSync(__dirname + `/application-${process.env.NODE_ENV}.yml`, 'utf8'));

So to change it you can rewrite value in your env project file

The value must be dev, prod or test.

If it is the problem, I can provide in the startup a code check if the NODE_ENV value (that is the app profile) is allowed having a related application.yml

@ghost
Copy link

ghost commented Jan 30, 2020

Hi @ajoysinhaabbvie, any news???

@kosnkow
Copy link

kosnkow commented Jan 31, 2020

we had the same problem so we changed:
-const yamlConfig = yaml.safeLoad(fs.readFileSync(__dirname + '/application.yml', 'utf8'));
-const envYamlConfig = yaml.safeLoad(fs.readFileSync(__dirname + /application-${process.env.NODE_ENV}.yml, 'utf8'));
+const yamlConfig = yaml.safeLoad(fs.readFileSync(__dirname + '/../../config/application.yml', 'utf8'));
+const envYamlConfig = yaml.safeLoad(fs.readFileSync(__dirname + /../../config/application-${process.env.NODE_ENV}.yml, 'utf8'));

@ghost ghost added the enhancement New feature or request label Jan 31, 2020
@ghost
Copy link

ghost commented Jan 31, 2020

It is linked to #99 that has more details.

@ghost
Copy link

ghost commented Feb 4, 2020

Fix with #102 , I will release the 1.0.0-beta.3

@ghost ghost added this to the 1.0.0-beta.3 milestone Feb 4, 2020
@ghost
Copy link

ghost commented Feb 4, 2020

Hi @ajoysinhaabbvie and @kosnkow ,
you can test the new version just published 1.0.0-beta.3. Feel free to open new issues if there are another problems. Thanks!

@ghost ghost closed this as completed Feb 4, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers more information is needed More information are required to understand issue
Projects
None yet
Development

No branches or pull requests

2 participants