RedHatProductSecurity / cvss-v4-calculator

CVSS v4.0 calculator

Home Page:https://redhatproductsecurity.github.io/cvss-v4-calculator/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot run the code locally.

JamesD357 opened this issue · comments

This may just be I don't know enough about setting up a Vue app and not really an issue. I also don't want to give unnecessary work for you. However, I cloned your code so I can run it locally so I can debug it using VS Code, however I'm running into issues trying to figure out how to implement this? I've not setup a github javascript app before, nor have I used Vue, so this could be something simple. However, it references Vue in the app.js file which throws this error when I used npm run ReferenceError: Vue is not defined from this line of code: const app = Vue.createApp({ ... in app.js. I was trying to set it up with Node.js and npm since I've used them in the past.

Also, there is a reference to the vue cnn in index.html:

<script src="https://unpkg.com/vue@3.2.45/dist/vue.global.prod.js"></script> and it's at the top of the scripts, so I would have thought it would have resolved itself.

I also don't see any node_modules, vue folders, nor a package.json. I assumed I had to build them and tried, but it didn't work. I'm not sure what is needed for this to run for my use case?

I didn't see anything in the license that would prevent me from doing this and I'm trying to understand CVSS more and the scoring for my job at work evaluating software. There really isn't any guide to setting this up and I didn't know if that was by design or just something not considered important, time wise.

I can open the HTML file in a browser so it runs that way, but I'm wanting to debug things line by line. Any ideas as to what I need to do and the steps for this to run in VS Code or something similar?

Any help or explanation would be appreciated.

From my own perspective, I used to open the index.html file in a browser and use console.log to "debug". It's far from being perfect but the current Vue setup has a complete rework to do to be a real front-end server.
FYI we know this issue in the FIRST.ORG SIG CVSS and discussed it, but no work was performed in this direction.

Okay, many thanks for the explanation! I spent all day yesterday trying to get this to run.
Yes, I have used console log many times as well, so I'll go that route, rather than trying to reinvent the wheel.

Yeah, I am not a Javascript developer myself so I used the simplest way to create a Vue application. "Real" web development would not do that, but Vue allows that for simple usage as described in the documentation part using Vue without a build step.

Understood. Not a problem, I just needed clarification so I would know what direction to take with it. I've done lots of Javascript, but not with Vue.