jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.48k stars 4.02k forks source link

aws sub-generated not working. #10472

Closed initfusion closed 4 years ago

initfusion commented 5 years ago
Overview of the issue

I have a newly created project using jhipster command. now I am trying to use aws sub-generated to deploy. I have created one folder in the root of the project and write command


Dharmeshs-Mac-mini:aws-deploy dharmesh$ jhipster aws               
INFO! Using JHipster version installed globally
INFO! Executing jhipster:aws
INFO! Options: from-cli: true

Just found a `.yo-rc.json` in a parent directory.
Setting the project root at: /Users/dharmesh/Workspace/Live/Crick2/Source/Crick2-Backend
Installing AWS dependencies
npm WARN @angular/core@8.2.4 requires a peer of zone.js@~0.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.

+ progress@2.0.3
+ uuid@3.3.3
+ aws-sdk@2.533.0
updated 3 packages and audited 908725 packages in 20.317s
found 3 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'aws-sdk'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at AwsFactory.shelljs.exec.code (/usr/local/lib/node_modules/generator-jhipster/generators/aws/lib/aws.js:41:19)
    at /usr/local/lib/node_modules/generator-jhipster/node_modules/shelljs/src/exec.js:121:9
    at ChildProcess.exithandler (child_process.js:285:7)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
Motivation for or Use Case
Reproduce the error

Create fresh project using v6.3.0 or v6.3.1 and use aws sub-generator.

Related issues
Suggest a Fix
JHipster Version(s)

v6.3.0 v6.3.1

JHipster configuration
JHipster Version(s)
crick-2@0.0.1-SNAPSHOT /Users/dharmesh/Workspace/Live/Crick2/Source/Crick2-Backend
└── generator-jhipster@6.3.1 
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.initfusion.crick2"
    },
    "jhipsterVersion": "6.3.1",
    "applicationType": "monolith",
    "baseName": "Crick2",
    "packageName": "com.initfusion.crick2",
    "packageFolder": "com/initfusion/crick2",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "gradle",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl",
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "angularX",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": false,
    "blueprints": [],
    "embeddableLaunchScript": false
  }
}

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

openjdk version "11.0.4" 2019-07-16 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)

git version 2.21.0 (Apple Git-122)

node: v10.16.3

npm: 6.11.3

yeoman: 3.1.0

Docker version 19.03.2, build 6a30dfc

docker-compose version 1.24.1, build 4667896b

SudharakaP commented 5 years ago

I've seen similar errors in the aws-containers sub-generator side but I could not reproduce this exact error on the aws subgenerator.

@initfusion : Could you please try the following;

1) Remove the node_modules folder.

2) Run npm install.

3) Start the subgenerator again (jhipster aws)

SudharakaP commented 5 years ago

Currently I am working on the aws-containers subgenerator and there I've refactored the code to add the aws-sdk as a fixed dependency rather than trying to install it at runtime. This seems to solve certain issues. I just created a PR which does the same thing for this sub-generator as well. :smile:

pascalgrimaud commented 4 years ago

@SudharakaP : can it be closed with all recent fixes in AWS sub gen ?

SudharakaP commented 4 years ago

@pascalgrimaud : These was fixed as part of #10494. In fact this issue will automatically be closed when you merge #10494. :smile: