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

Fresh install of vmw-cli fails with node v14.16.0. #4

Open
GrahamDumpleton opened this issue May 4, 2021 · 1 comment
Open

Fresh install of vmw-cli fails with node v14.16.0. #4

GrahamDumpleton opened this issue May 4, 2021 · 1 comment

Comments

@GrahamDumpleton
Copy link

Installing a fresh copy using npm and trying to run it yields the following error.

Not sure if this is a new incompatibility with node version being used, or something else.

Any idea of what issue would be appreciated.

[~/exercises/xxx] $ cat /etc/system-release
Fedora release 31 (Thirty One)
[~/exercises/xxx] $ node --version
v14.16.0
[~/exercises/xxx] $ ./node_modules/.bin/vmw-cli 
internal/modules/cjs/loader.js:1080
      throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
      ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/eduk8s/exercises/xxx/node_modules/p-map/index.js
require() of ES modules is not supported.
require() of /home/eduk8s/exercises/xxx/node_modules/p-map/index.js from /home/eduk8s/exercises/xxx/node_modules/vmw-cli/lib/vmw.api.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/eduk8s/exercises/xxx/node_modules/p-map/package.json.

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/eduk8s/exercises/xxx/node_modules/vmw-cli/lib/vmw.api.js:8:14)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14) {
  code: 'ERR_REQUIRE_ESM'
}
@remkolodder
Copy link

See #12 which would resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants