diff --git a/.github/workflows/pr-testing-with-test-project.yml b/.github/workflows/pr-testing-with-test-project.yml index 87cbc7daaa..b9199a896b 100644 --- a/.github/workflows/pr-testing-with-test-project.yml +++ b/.github/workflows/pr-testing-with-test-project.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [ '12', '14', '16', '18' ] + node: [ '14', '16', '18', '20' ] steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/docs/installation-guide.md b/docs/installation-guide.md index 9db49b21df..c902c20d25 100644 --- a/docs/installation-guide.md +++ b/docs/installation-guide.md @@ -9,8 +9,8 @@ You can use the generator library to generate whatever you want in your event-dr ## Prerequisites Before you install and use the AsyncAPI CLI and the generator library, ensure you meet the prerequisites below, then [install the CLI](#installation). -1. Node.js v12.16 and higher -2. Npm v6.13.7 and higher +1. Node.js v16.20.2 and higher +2. Npm v8.19.4 and higher To verify the versions of Node and Npm you have, run the following command on your terminal: ``` diff --git a/lib/generator.js b/lib/generator.js index 1ac8f22b9b..631012f32e 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -8,6 +8,8 @@ const git = require('simple-git'); const log = require('loglevel'); const Arborist = require('@npmcli/arborist'); const Config = require('@npmcli/config'); +const requireg = require('requireg'); +const npmPath = requireg.resolve('npm').replace('index.js',''); const { isAsyncAPIDocument } = require('@asyncapi/parser/cjs/document'); @@ -583,8 +585,6 @@ class Generator { if (isFileSystemPath(this.templateName)) log.debug(logMessage.NPM_INSTALL_TRIGGER); - const npmPath = process.execPath.replace('/bin/node','/lib/node_modules/npm/'); - const config = new Config({ definitions, flatten, diff --git a/package.json b/package.json index 1e465d487f..dcb6fb86ed 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "ag": "./cli.js" }, "engines": { - "node": ">12.16", - "npm": ">6.13.7" + "node": ">16.20.2", + "npm": ">8.19.4" }, "scripts": { "test": "npm run test:unit && npm run test:integration && npm run test:cli", @@ -66,6 +66,7 @@ "minimatch": "^3.0.4", "node-fetch": "^2.6.0", "nunjucks": "^3.2.0", + "requireg": "^0.2.2", "resolve-from": "^5.0.0", "resolve-pkg": "^2.0.0", "semver": "^7.3.2",