Question: How do I add a library? Trying to convert a block-based code project to another file type, Xml to js is what I going for. I have “X2JS” but do not know how to import it
Are you asking something like this? Getting started with Node.js modules: require, exports, imports and beyond | Adrian Mejia Blog
Welcome to the community! is this for frontend or backend?
I don’t know what either of those means. I’m new so explain… baby terms.
I used an XML to JS Object converter but it used colins instead of semicolons.
And thanks for the welcome =]
oh I see. Your doing frontend. If you have the library, you can just do
<script src = "library cdn url"> </script> inside your html page. EDIT: do you know html?
Frontend: What the user sees when they go to your page
Backend: The server, basically the user makes requests to it and the server makes a request to display html and css and stuff
If you have a HTML file, you can insert a
<script> of the library you want to install in the header/top of your body in your file.
You could also install the library via npm by typing
$ npm install WHATEVER_LIBRARY in the shell.
No HTML file unfortunately.
then install the library via npm:
$ npm install WHATEVER_LIBRARY
Can I do this in replit?
Also apologies if Im being hard to work with, trying my best to understand with my limited knowledge and hardware.
Yes, you can. To open the shell, you will first need to create a new tab and type “shell” into the search bar. Click on the first result and start typing the library you want to install.
I did, said it needed an update, and i did. but its yelling at me for a bunch of errors. I also cant add a screenshot because it also yells at me.
EDIT: Screenshot to this reply, cant add it here.
can i ask what library you are installing? i may be able to help you with finding out what’s wrong.
X2JS by Maxouhell (Github name)
[ Github ] [ npm ]
(I never heard or npm until you said it but i now realizied that its also a site and not a downloadable program)
it seems to be alright with installing the library. if it asks for an update, it should still be okay to run it.
if you want to be sure, you can just type the npm command it gave before the last
I will try on a new repl project, install the libary (or try), and report back.
EDIT2: Ill use the “HTML, CSS, JS”
Report: I was able it add without errors, but only when I typed “npm install -g email@example.com” did I get errors.
EDIT: It also asked me to add node.js and I added nodejs-16_x
EDIT2: Ive also reached a max number of replys? Ill add what ill report to using a nodejs template @dragonhunter1
EDIT3: It worked! Ill try to look around and figure things out and if I get nowhere, Ill come back.
EDIT4: Yea no. So I have a libary, but both npm and github isnt being helpful, I have the github file, so do i upload anything? When i run the “quickstart” code, it gives me an error.