eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.22k stars 868 forks source link

Cannot read property 'resolve' of undefined at regFetch #950

Closed mikolasz closed 3 years ago

mikolasz commented 3 years ago

Hi Colleagues,

Description of erroneous behaviour

When I trying to run a mvn clean install on the project I got the following error here:

[INFO] --- frontend-maven-plugin:1.11.0:install-node-and-npm (install-node-and-npm) @ plmcore ---
[INFO] Node v12.19.1 is already installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.11.0:npm (npm install) @ plmcore ---
[INFO] Running 'npm install' in C:\Users\x\Dev\VSCodeworkspace\productdb\srv
[INFO] npm ERR! Cannot read property 'resolve' of undefined

at regFetch (C:\Users\x\Dev\VSCodeworkspace\productdb\srv\node\node_modules\npm\node_modules\npm-registry-fetch\index.js:88:23)

Full log: 2020-12-22T09_26_46_128Z-debug.log

Project: https://github.wdf.sap.corp/epd-plmcore/specification

my .npmrc file content:

@sap:registry=http://nexus.wdf.sap.corp:8081/nexus/content/groups/build.releases.npm/
strict-ssl=false

our pom.xml: https://github.wdf.sap.corp/epd-plmcore/specification/blob/master/pom.xml

Operation System: Win 10 x64

Best Regards, Laszlo

eirslett commented 3 years ago

The link to your pom.xml is unreachable. Looks like a company-internal URL, think you would need to work at SAP to access it.

What happens if you try running npm install - not with Maven, but directly on the command line? (Using Node v12.19.1) Does it work then, or do you get the same error?

mikolasz commented 3 years ago

Yes, that's an internal link. Sorry for not sharing with anyone. for running npm install I don't get any error only just vulnerabilities:

added 85 packages from 52 contributors and audited 869 packages in 14.128s

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

found 8 vulnerabilities (2 low, 1 moderate, 4 high, 1 critical)
eirslett commented 3 years ago

Which version of node/npm did you specify in pom.xml? Try changing it to the latest versions? It could be a bug in npm that is triggered with your pom's specfic version setup.

mikolasz commented 3 years ago

Oh wait! I checked that I have Node.js: v12.19.0 So I changed the version back v12.19.1 to v12.19.0 and it works! :)

<!-- NODE DEPENDENCIES VERSION -->    
<node.version>v12.19.0</node.version>

Thanks for the good questions what we helped me to solve the issue 👍