Generator-jhipster: Unable to initialise new project. Fails with: Cannot find name 'Cheerio'.

Created on 26 Sep 2020  路  7Comments  路  Source: jhipster/generator-jhipster

Overview of the issue

Unable to initialise a new project with react frontend. Initialisation finishes but ./mvnw fails with an error

 ERROR  Failed to compile with 33 errors                                                                                                                                       6:28:38 AM

 error  in /project/node_modules/@types/enzyme/index.d.ts

ERROR in /project/node_modules/@types/enzyme/index.d.ts(384,15):
TS2304: Cannot find name 'Cheerio'.

##### **Motivation for or Use Case** Initialising a new project ##### **Reproduce the error** Steps * Initialise using `jhipster` command * Run ./mvnw It fails with this error
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.10.0:npm (webpack build dev) on project testapp-1: Failed to run task: 'npm run webpack:build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]
Running `npm run webpack:build` fails this error `TS2304: Cannot find name 'Cheerio'.` To confirm it's not related specifically to my environment I used the docker image to create a project from scratch and faced the same issue
docker pull jhipster/jhipster

# and ran these commands inside the container
   15  cd app
   17  jhipster 
   18  ./mvnw
   19  npm run webpack:build
##### **Related issues** NA ##### **Suggest a Fix** NA ##### **JHipster Version(s)**
[email protected] /home/jhipster/app
`-- [email protected] 

##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.mycompany.myapp"
    },
    "jhipsterVersion": "6.10.3",
    "applicationType": "monolith",
    "baseName": "app",
    "packageName": "com.mycompany.myapp",
    "packageFolder": "com/mycompany/myapp",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "embeddableLaunchScript": false,
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "react",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1601102189906,
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": false,
    "blueprints": []
  }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory


JDL entity definitions


Environment and Tools

openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)

git version 2.17.1

node: v12.16.1

npm: 6.14.8

yeoman: 3.1.1

yarn: 1.22.5

```

Browsers and Operating System

Able to replicate this on Mac and Docker

area react v6

Most helpful comment

Looks like the issue is with enzyme:

Bumping up enzyme to 3.10.7 fixes the problem for me.

"@types/enzyme": "3.10.7",

All 7 comments

Thanks for reporting this @vik-y
I confirm the issue, and it seems related to one of the dependency

Looks like the issue is with enzyme:

Bumping up enzyme to 3.10.7 fixes the problem for me.

"@types/enzyme": "3.10.7",

I don't see the issue in master branch, so for me, it's only in v6
@vik-y : would you like to provide the fix for v6.x_maintenance branch plz ?

@pascalgrimaud , Sure, will do that 馃憤

Looks like the issue is with enzyme:

Bumping up enzyme to 3.10.7 fixes the problem for me.

"@types/enzyme": "3.10.7",

Great quick fix. Worked for me 馃憤

Looks like the issue is with enzyme:

Bumping up enzyme to 3.10.7 fixes the problem for me.

"@types/enzyme": "3.10.7",

Awesome, this fixed my issue using the web generated version that I created today. Thank you Vikas!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shivroy121 picture shivroy121  路  3Comments

edvjacek picture edvjacek  路  3Comments

dronavallisaikrishna picture dronavallisaikrishna  路  3Comments

RizziCR picture RizziCR  路  3Comments

ahmedeldeeb25 picture ahmedeldeeb25  路  3Comments