The FCC NPM instructions say that you can use Replit or you can use your own local machine and host a public URL. I opted for the second option so I can get more github and other practical experience, but I can’t figure out how to make the first test pass without a Replit link.
The task itself is just adding an author to the package.json, which is super simple so I know I’m not messing that part up.
I’d prefer to do this section locally instead of on Replit, but what exactly do I need to plug into that input field to get it to recognize my package.json?
Is github pages a no-go? Do I need a different hosting service?
I’ll use Replit if I really have to but I need practice with Git and actually hosting my own stuff so I’d prefer not to lean on Replit unless I really have to.
A basic webpage host can’t run a Node.js application, for that you need a webserver with properly installed packages for the application. This would have to be a service, like Replit, Heroku, AWS, or others that can host applications, not just websites. It’s also possible if you have a static IP from your webprovider to run a server from your computer to serve up your application… but that would take a bit of work on your end.
I’ve done projects locally, and uploaded them to Replit after they were finished… I also wanted to learn Github, so started using that with my local VSCode implementation, and heard that Heroku could import and host your page directly from Github, but I guess they disabled the direct import feature for security reasons. Got it to work, but had to manually upload my files to Heroku.
That makes sense. Thanks! While you’re around, I don’t suppose you know how to get a live app link on Replit? I’ve been googling for a while now (since before I posted this thread) trying to get Replit to give me a live app link but I can’t figure it out.
I don’t need to “publish” do I? I tried publishing and got as far as the part where it wanted me to upload a cover picture and I figured that probably wasn’t what I needed to do just to get a live app link.
There’s a lot of threads on the forum that talk about getting a live app link on Replit; I found one where Sky020 even gave a picture:
Here’s the post: How to submit repl.it to Freecodecamp?
But I’m still failing to figure out how to get a live app link on Replit…
I can’t find that miniature browser that Sky020 was talking about when I hit the run button. It just throws a bunch of errors when I run it.
Now you can edit your code, but when you want to test/run it, you can hit the Run button I’ve circled at the top. When you do that, it should run your code, and on the right it should show a preview of your page, with that live link at the top, and the console at the bottom. While running you should also be able to pop that live link into a web browser and also see your page. If an error occurs it will stop your program, or you can click the stop bottom at the top to stop it.
Yeah, you’re not going to see a live-link until you can get your code to run without errors.
Quick question, did you create a blank Replit and import your files from Github, or did you use the link in the challenge to have it automatically create a Replit for you?
The only reason I ask is because I believe Replit should have installed all dependencies automatically… but if you created a blank replit rather than having it create one for you, that option might not be enabled.
Weird… I’ve never messed with Replit much outside of the course load, but typically, the first time you hit the Run button, Replit automatically installed any dependencies listed before attempting to run the code… maybe it was because your package.json originally had a syntax error that it didn’t do that… Working on my home PC, yeah, I have to manually install any required packages into my Node.JS inviroment, but Replit has always done that automatically for me.
I just had the exact same problem when I moved on to the “Basic Node & Express” section. I had to run npm i express in the shell again to get things running, even though I used the Replit starter project link provided in the curriculum.