NealWalters
NealWalters

Reputation: 18207

with grapejs - did "npm start", but localhost:8080 will say This site can’t be reached localhost refused to connect

I downloaded the zip (from https://github.com/artf/grapesjs) and unzipped, then did the "npm i" command. That tooks a while, then I ran "npm start" and the console displayed this:

e:\GitHub\NealWalters\GrapeJSDemo>npm start

[email protected] start e:\GitHub\NealWalters\GrapeJSDemo npm run build:css -- -w & webpack-dev-server --open --progress --colors

[email protected] build:css e:\GitHub\NealWalters\GrapeJSDemo node-sass src/styles/scss/main.scss dist/css/grapes.min.css --output-style compressed "-w"

When I try http://localhost:8080 in the browser, I get the error: This site can’t be reached localhost refused to connect.

Here is my directory structure: enter image description here

I have run other NodeJS programs before with success. Running on Windows 10.

Upvotes: 0

Views: 1496

Answers (1)

Jeff Hernandez
Jeff Hernandez

Reputation: 2123

On npm start, the process gets bound to watching files and doesn't reach the next command to startup the server. Try adding start in the beginning of the start script to run a separate process for watching the files. Then the command to startup the server will get executed.

So in package.json, change the start script to the following:

{
  ...
  "scripts": {
    ...
    "start": "start npm run build:css -- -w & webpack-dev-server --open --progress --colors"
}

Upvotes: 2

Related Questions