Ask coding questions

← Back to all posts
Node.js in tries to install "https:" on run[Solved]
tussiez (1645)

I've been working on a new project in, and I had to use the shell to run the app because whenever I tried using the Run button, would do the following: Updating package configuration
npm install https:
// And then an error would show up here, saying that the link is invalid.

This makes the Run button useless. Are there any workarounds/fixes for this, aside from using the shell?

Reason: Replit tries installing client-side modules with npm from public/index.js, which results in an error, since these are not NPM modules. The solution is to add a .replit file, if you don't already have one, and add the following text:

run="node ."


where "public" is the folder where your client-side code typically is in. This will make the packager ignore files in /public, which fixes the issue.

Answered by Coder100 (18089) [earned 5 cycles]
View Answer
Coder100 (18089)

this is the reason:

easy fix add this to your .replit:


realTronsi (929)

did you happen to do

const https = require("https:");

otherwise please link the repl so we can diagnose the problem