mitre-attack / attack-navigator

Web app that provides basic navigation and annotation of ATT&CK matrices
https://mitre-attack.github.io/attack-navigator
Apache License 2.0
1.92k stars 578 forks source link

How to build project with node version. #636

Closed leeliu48307 closed 1 month ago

leeliu48307 commented 1 month ago

Hi, I clone this project into my local. run npm install. Then I got different error message. I just want to know what is the right node, npm, angular/cli version in order to build the project at my local? Really appreciate it.

I am working CISA for vulerability.

clemiller commented 1 month ago

Hi @leeliu48307,

As specified in the README, Navigator requires Node v16. Node v18 should also work. Navigator is currently using Angular v14.

leeliu48307 commented 1 month ago

Thank you very much !!

leeliu48307 commented 1 month ago

Question: My current node version :v20.12.2. When ng version, I got angular:14.2.13. Warning: The current version of Node (20.12.2) is not supported by Angular. VM system does not have v16 or v18 (I have to maintain or try Node v20). Then I npm install, I got error message: Resovle could not resolve , while resovling:@angular-builders/custom-webpack@17.0.2 found @angular/compile-cli@14.3.0. How to fix it? Really appreciate it.

clemiller commented 1 month ago

The first issue you're seeing is a warning due to compatibility issues between the Angular and Node versions. Angular v14 does not support Node.js v20, which may cause issues during the installation process. Angular v14 is compatible with Node.js v14 and v16. If it's possible for you to do so on your VM, I'd recommend using nvm (Node Version Manager) to manage and switch between different node versions. We are in the process of upgrading to Angular v17+, but do not currently have a timeline on when that will be released.

The second issue is a dependency resolution error related to @angular-builders/custom-webpack and @angular/compiler-cli, indicating a mismatch in package versions. This happens when dependencies are not aligned with the Angular version being used. The following steps should help resolve this issue:

  1. Clear your npm cache: npm cache clean --force
  2. Remove existing modules: rm -rf node_modules
  3. Reinstall dependencies: npm i

If the above steps don't resolve your issue, try regenerating the package-lock.json file:

  1. Remove the lock file: rm package-lock.json
  2. Reinstall: npm i
leeliu48307 commented 1 month ago

Thanks for update. I will inform system admin this message, let them to update node v to 16v or 18v.

leeliu48307 commented 1 month ago

Now I install node v16, angular v14 and run npm install, got the following errors. Any suggestion is high appreciated. 20240516_084645 20240516_084527 20240516_084546