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

Dependency on node.js/npm version and incompatibility with nvm (node.js version manager) #80

Open
FALLAI-Denis opened this issue May 22, 2021 · 1 comment
Labels

Comments

@FALLAI-Denis
Copy link

We use the nvm software, node.js version manager, to be able to quickly switch from one version of node.js to another.
This is a need of our organization.

With nvm, each version of node.js/npm is installed in a different folder, with a subfolder containing the npm modules.
@zowe/cli is an npm module, and therefore when activating a node.js/npm version for the first time, the @zowe/cli module must be reinstalled.
The installation of @zowe/cli detects previous installation of zowe plugins which are installed outside of the npm modules subfolder.

We noticed, during a version switch of node.js to an earlier version, that the plugin @zowe/db2-for-zowe-cli was dependent on the npm version used when it was installed:

>nvm list
  * 16.0.0  (Currently using 64-bit executable)
    14.17.0 
  
> nvm use 14.17
14.17.0

> npm install -g @zowe/cli
 @zowe/cli@6.31.0 postinstall C:\Users\{username}\node_modules\@zowe\cli
> node ./scripts/validatePlugins

Since you re-installed Zowe CLI, we are re-validating any plugins.

_____ Validation results for plugin '@zowe/cics-for-zowe-cli' _____
This plugin was successfully validated. Enjoy the plugin.

_____ Validation results for plugin '@zowe/zos-ftp-for-zowe-cli' _____
This plugin was successfully validated. Enjoy the plugin.

_____ Validation results for plugin '@broadcom/endevor-for-zowe-cli' _____
This plugin was successfully validated. Enjoy the plugin.

_____ Validation results for plugin '@broadcom/endevor-bridge-for-git-for-zowe-cli' _____
This plugin was successfully validated. Enjoy the plugin.

_____ Validation results for plugin '@ibm/rse-api-for-zowe-cli' _____
This plugin was successfully validated. Enjoy the plugin.

_____ Validation results for plugin '@zowe/db2-for-zowe-cli' _____

*** CmdError: Failed to combine command definitions. Reason = Encountered an error loading one of the files (cli/call/Call.definition.js) that matched the provided command module glob for the glob function glob (pattern, options, cb) {
  if (typeof options === 'function') cb = options, options = {}
  if (! options) options = {}

  if (options.sync) {
    if (cb)
      throw new TypeError ('callback provided to sync glob')
    return globSync (pattern, options)
  }

  return new Glob (pattern, options, cb)
}: The module '\\?\C:\Users\{username}\.Zowe\plugins\installed\node_modules\@zowe\db2-for-zowe-cli\node_modules\ibm_db\​​build\Release\odbc_bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 83. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or` npm install`).

This plugin has command errors. No plugin commands will be available.

npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\{username}\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\{username}\package.json'
npm WARN {username} No description
npm WARN {username} No repository field.
npm WARN {username} No README data
npm WARN {username} No license field.

+ @zowe/cli@6.31.0
added 287 packages from 202 contributors and audited 287 packages in 84.572s

14 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> zowe --version
'zowe' is not recognized as an internal command
or external, an executable program or a batch file.

> npm list -g --depth = 0
C:\ProgramData\ nodejs
`- npm@6.14.13

Because of this, the @zowe/cli module cannot be installed on the newly activated node.js version.

To solve the problem, you must:

  • switch back to the old node.js version
  • uninstall the @zowe/db2-for-zowe-cli plugin
  • switch back to the new node.js version
  • install the npm @zowe/cli module
  • reinstall the @zowe/db2-for-zowe-cli plugin
@zFernand0
Copy link
Member

@FALLAI-Denis,
Does the issue still occur in newer versions of the plug-in and nodejs?

@t1m0thyj t1m0thyj moved this to Low Priority in Zowe CLI Squad Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Low Priority
Development

No branches or pull requests

2 participants