Ask coding questions

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

I've been working on a new project in Repl.it, and I had to use the shell to run the app because whenever I tried using the Run button, Repl.it would do the following:

Repl.it: 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?

SOLVED
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 ."

[packager]
ignoredPaths=["public"]

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
Comments
hotnewtop
Coder100 (18089)

this is the reason:

easy fix add this to your .replit:

[packager]
ignoredPaths=["public"]

https://docs.repl.it/repls/dot-replit

realTronsi (929)

did you happen to do

const https = require("https:");

otherwise please link the repl so we can diagnose the problem