Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Unable to (un-)install plugins wit node.js 16x or 17.x #683

Closed
BJostmeyer opened this issue Oct 25, 2021 · 6 comments
Closed

Unable to (un-)install plugins wit node.js 16x or 17.x #683

BJostmeyer opened this issue Oct 25, 2021 · 6 comments

Comments

@BJostmeyer
Copy link

Since a couple of days we encounter problems using zowe CLI to install or uninstall plug-ins. First we encountered the problem in our Jenkins build - when trying to automatically install our self developed plug-in

However - even on our Linux development machine we have now same problem with 16.x or 17.x

The problem looks like:

`zowe plugins install @ask Zowe/secure-credential-store-for-zowe-cli@zowe-v1-lts
node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module '/home/friessin/.nvm/versions/node/v17.0.1/lib/node_modules'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v17.0.1
Command Error:
Install Failed`

Is this already a known problem? Any suggestions?

@BJostmeyer BJostmeyer changed the title Unable to (un-)install plugins wit nodee 16x or 17.x Unable to (un-)install plugins wit node.js 16x or 17.x Oct 25, 2021
@t1m0thyj
Copy link
Member

t1m0thyj commented Oct 26, 2021

Thanks for reporting, we are investigating this issue.

Until an official fix is published, a workaround is to downgrade your version of NPM from 8 to 7: npm install -g npm@7

Also, please note that Zowe CLI only supports LTS versions of Node.js. Node.js 16 is not technically LTS yet, but is expected to be released as LTS later today so it will be supported. However, Node.js 17 is not an LTS version and will not be supported. For the Node.js release schedule, see https://nodejs.org/en/about/releases/

@BJostmeyer
Copy link
Author

Thanks for reply. We are trying this... However in our Jenkins Build environment we are running the NPM Plugin and use its environment also for the zowe CLI - until last week it worked fine - but somehow the Jenkins NPM plugin must have been updated :( and installed a newer version of NPM - we did not control this.
Now it seems that we cannot use the NPM plugin's environment anymiore but have to create everthing as steps within a shell.

@awharn awharn transferred this issue from zowe/zowe-cli Oct 26, 2021
@t1m0thyj
Copy link
Member

t1m0thyj commented Oct 27, 2021

I'm not familiar with the NPM Plugin for Jenkins. If it has an option in Jenkins settings to use an older version of NPM, that could work around the issue. Otherwise, I'm afraid the only workaround would be shell commands as you mentioned.

We have found a fix for the issue, and hope to publish it soon. We'll let you know when an official fix is available, which should work without any extra shell commands or configuration changes to your NPM Plugin 🙂

@awharn
Copy link
Member

awharn commented Oct 27, 2021

Hello,

I took a look and determined that a change in NPM version 8 results in Imperative failing to find the global NPM module. This makes sense, as Node 16 and 17 both ship with NPM version 8 by default, and Node 16 just became LTS. I've made changes to how Imperative resolves the npm module, and updated the CLI to absorb these changes. We have done some testing locally, verified that we could reproduce the issue before the change, and verified that the updated CLI no longer reproduces the issue in our environment.

We have just published the updated CLI to NPM. Can you please update the CLI installed in your environment to the latest version (using any of the following as the package tag: @latest, @zowe-v1-lts, @6.36.1) and try again? I believe it should resolve your issue.

@tfriess
Copy link

tfriess commented Oct 29, 2021

Hello,

thanks for the quick update! I updated to the @latest version of Zowe CLI and was now able to use it without anny issues with Node 16 or 17 (including NPM v8). Great!

@awharn
Copy link
Member

awharn commented Oct 29, 2021

Thanks for the feedback! We are going to go ahead and close this issue.

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

No branches or pull requests

4 participants