nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.44k stars 276 forks source link

Cannot install frontend-maven-plugin #4407

Closed mghiremath closed 2 weeks ago

mghiremath commented 3 months ago

Affected URL(s)

No response

Description of the problem

Cannot install frontend-maven-plugin on Node v20.12.0

error:

 --- frontend-maven-plugin:1.14.0:npm (npm install) @ frontend ---
[INFO] Running 'npm install' in /Users/bharath/Documents/Lazy Programs/MyTube_Project/MyTube/frontend/mytube-ui
[INFO] /Users/bharath/Documents/Lazy Programs/MyTube_Project/MyTube/frontend/mytube-ui/node/node_modules/npm/lib/es6/validate-engines.js:31
[INFO]     throw err
[INFO]     ^
[INFO] 
[INFO] TypeError: Class extends value undefined is not a constructor or null
[INFO]     at Object.<anonymous> (/Users/bharath/Documents/Lazy Programs/MyTube_Project/MyTube/frontend/mytube-ui/node/node_modules/npm/node_modules/fs-minipass/lib/index.js:136:4)
[INFO]     at Module._compile (node:internal/modules/cjs/loader:1369:14)
[INFO]     at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
[INFO]     at Module.load (node:internal/modules/cjs/loader:1206:32)
[INFO]     at Module._load (node:internal/modules/cjs/loader:1022:12)
[INFO]     at Module.require (node:internal/modules/cjs/loader:1231:19)
[INFO]     at require (node:internal/modules/helpers:179:18)
[INFO]     at Object.<anonymous> (/Users/bharath/Documents/Lazy Programs/MyTube_Project/MyTube/frontend/mytube-ui/node/node_modules/npm/node_modules/cacache/lib/content/read.js:4:13)
[INFO]     at Module._compile (node:internal/modules/cjs/loader:1369:14)
[INFO]     at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
[INFO] 
[INFO] Node.js v20.12.0
karendolan commented 1 month ago

I had the same error after moving to a new device and copying over my project. I suspect deleting the old node and node_modules from my project was what actually what worked. But I included all 4 steps, in case it is relevant.

The following stepped stopped the TypeError: Class extends value undefined is not a constructor or null related to minipass on the maven build in my project:

  1. I made the project build node the same as my system's global node, which was v22.2.0
  2. I upgrade my global npm npm update -g npm
  3. I deleted my project's local node directory
  4. I deleted my project's local node_modules directory
RedYetiDev commented 1 month ago

@mghiremath did @karendolan's solution work?