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

npm detection not reliable and redundant #966

Closed
hohwille opened this issue Nov 3, 2022 · 0 comments · Fixed by #969
Closed

npm detection not reliable and redundant #966

hohwille opened this issue Nov 3, 2022 · 0 comments · Fixed by #969
Assignees
Labels
bug Something isn't working npm node package manager setup related to the setup process of devonfw-ide (setup[.bat] and devon ... setup)

Comments

@hohwille
Copy link
Member

hohwille commented Nov 3, 2022

We have the commandlets that call npm and have redundant logic to detect it that also seems to be buggy.
The commandlets based on npm are:

  • ionic
  • ng
  • yarn

Instead of finding npm inside these commandlets to call doRunCommand "npm install ..." we should simply delegate to doDevonCommand npm install ....

Copied from PR #934:
During the setup of npm a 'MODULE_NOT_FOUND' blocks the installation of ionic.
To be more precise, I've been getting the following error after the installation of node seemed
to be complete:

`node:internal/modules/cjs/loader:998
throw err;
^

Error: Cannot find module '/home/dr/projects/PR934/software/node/bin/node_modules/npm/bin/npm-cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v19.0.0
Could not determine Node.js install directory

******** ATTENTION ********
Failed to install ionic-cli ('/home/dr/projects/PR934/software/node/npm')
We are sorry for the inconvenience. Please check the above errors, resolve them and try again.
Exit code was 1
`

Full log of this error can be found here: https://github.com/alfeilex/ide/actions/runs/3368418467/jobs/5586938443#step:4:11593

In my case the npm-cli.js file has the following path

/home/dr/projects/PR934/software/node/node_modules/npm/bin/npm-cli.js

instead of

/home/dr/projects/PR934/software/node/bin/node_modules/npm/bin/npm-cli.js

It seems that the errors occurs because the npm_command uses the path from here:

local npm_command="${DEVON_IDE_HOME}/software/node/npm"

but it must be the path from here:
npm_command="${DEVON_IDE_HOME}/software/node/bin/npm"

@hohwille hohwille added bug Something isn't working setup related to the setup process of devonfw-ide (setup[.bat] and devon ... setup) npm node package manager labels Nov 3, 2022
@Amueller36 Amueller36 self-assigned this Nov 7, 2022
@hohwille hohwille linked a pull request Nov 7, 2022 that will close this issue
Amueller36 added a commit to Amueller36/ide that referenced this issue Nov 14, 2022
hohwille added a commit to Amueller36/ide that referenced this issue Nov 15, 2022
@hohwille hohwille linked a pull request Nov 15, 2022 that will close this issue
@hohwille hohwille added this to the release:2022.11.002 milestone Nov 15, 2022
hohwille added a commit to Amueller36/ide that referenced this issue Nov 17, 2022
hohwille added a commit to Amueller36/ide that referenced this issue Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working npm node package manager setup related to the setup process of devonfw-ide (setup[.bat] and devon ... setup)
Projects
None yet
3 participants