jhipster / generator-jhipster-react-native

A React Native blueprint for JHipster
https://jhipster-sample-app-react-native.vercel.app/
Apache License 2.0
266 stars 54 forks source link

Error parsing options for generator jhipster-react-native:app, unknown option will lead to error at jhipster 7 #261

Closed EnziinSystem closed 3 years ago

EnziinSystem commented 3 years ago

My JDL file (from demo example):

application {
  config {
    applicationType monolith
    authenticationType jwt
    baseName academy
    buildTool maven
    cacheProvider ehcache
    clientFramework react
    clientPackageManager npm
    databaseType sql
    devDatabaseType h2Disk
    dtoSuffix DTO
    enableHibernateCache true
    enableSwaggerCodegen false
    enableTranslation true
    jhiPrefix academy
    languages [en]
    messageBroker false
    nativeLanguage en
    packageName com.enziin.academy
    prodDatabaseType postgresql
    reactive false
    searchEngine false
    serverPort 8080
    serviceDiscoveryType false
    skipClient true
    skipServer false
    skipUserManagement false
    testFrameworks []
    websocket false
  }

  entities Country, Department, Employee, Job, JobHistory, Location, Region, Task
}

entity Country {
  countryName String
}

entity Department {
  departmentName String required
}

entity Employee {
  firstName String
  lastName String
  email String
  phoneNumber String
  hireDate Instant
  salary Long
  commissionPct Long
}

entity Job {
  jobTitle String
  minSalary Long
  maxSalary Long
}

entity JobHistory {
  startDate Instant
  endDate Instant
  language Language
}

entity Location {
  streetAddress String
  postalCode String
  city String
  stateProvince String
}

entity Region {
  regionName String
}

entity Task {
  title String
  description String
}

enum Language {
  FRENCH,
  ENGLISH,
  SPANISH
}

relationship OneToOne {
  JobHistory{job} to Job
  JobHistory{department} to Department
  JobHistory{employee} to Employee
}

relationship OneToMany {
  Department{employee(email)} to
  Employee{department(departmentName)}
  Employee{job(jobTitle)} to Job{employee(email)}
}

relationship ManyToOne {
  Country{region(regionName)} to Region
  Department{location(streetAddress)} to Location
  Employee{manager} to Employee
  Location{country(countryName)} to Country
}

relationship ManyToMany {
  Job{task(title)} to Task{job(jobTitle)}
}

dto Country, Department, Employee, Job, JobHistory, Location, Region, Task with mapstruct
service Country, Department, Employee, Job, JobHistory, Location, Region, Task with serviceClass
paginate Employee, JobHistory with infinite-scroll
paginate Job with pagination

The error:

INFO! Using JHipster version installed in React Native
INFO! From: undefined
INFO! No custom sharedOptions found within blueprint: generator-jhipster-react-native at /usr/lib/node_modules/generator-jhipster-react-native
INFO! No custom commands found within blueprint: generator-jhipster-react-native at /usr/lib/node_modules/generator-jhipster-react-native
INFO! **Error parsing options for generator jhipster-react-native:app, unknown option will lead to error at jhipster 7**
INFO! Executing import-jdl mobi.jdl
INFO! The JDL is being parsed.
info: The dto option is set for Country, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The dto option is set for Department, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The dto option is set for Employee, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The dto option is set for Job, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The dto option is set for JobHistory, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The dto option is set for Location, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The dto option is set for Region, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The dto option is set for Task, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
INFO! Found entities: Country, Department, Employee, Job, JobHistory, Location, Region, Task.
INFO! The JDL has been successfully parsed
INFO! Generating 1 application.
INFO! No custom sharedOptions found within blueprint: generator-jhipster-react-native at /usr/lib/node_modules/generator-jhipster-react-native
     info Using blueprint generator-jhipster-react-native for app subgenerator
EnziinSystem commented 3 years ago

And

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: academy@0.0.1
npm ERR! Found: react-native-web@0.14.13
npm ERR! node_modules/react-native-web
npm ERR!   react-native-web@"~0.14.13" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-web@"~0.13.7" from jest-expo@40.0.2
npm ERR! node_modules/jest-expo
npm ERR!   dev jest-expo@"^40.0.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/kevin/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kevin/.npm/_logs/2021-03-26T02_33_38_340Z-debug.log

Changes to package.json were detected.

Running npm install for you to install the required dependencies.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: academy@0.0.1
npm ERR! Found: react-native-web@0.14.13
npm ERR! node_modules/react-native-web
npm ERR!   react-native-web@"~0.14.13" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-web@"~0.13.7" from jest-expo@40.0.2
npm ERR! node_modules/jest-expo
npm ERR!   dev jest-expo@"^40.0.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/kevin/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kevin/.npm/_logs/2021-03-26T02_33_43_370Z-debug.log
Error running generator app: Error: Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
    at makeError (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/index.js:114:26)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  shortMessage: 'Command failed with exit code 1: npm install',
  command: 'npm install',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
ERROR! Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
    at makeError (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/index.js:114:26)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  shortMessage: 'Command failed with exit code 1: npm install',
  command: 'npm install',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
ruddell commented 3 years ago

This looks like an npm v7 issue with peer-dependencies. Just made a new release with a workaround which adds an .npmrc with legacy-peer-deps to the root of the project.

Should be fixed in https://github.com/ruddell/generator-jhipster-react-native/commit/4ec0ee944e0789e0491558ddf947ce1979a145bf

Thank you for reporting and please let me know if you have any more issues.