nuejs / create-nue

A recommended way to start a Nue project
https://nuejs.org
139 stars 30 forks source link

`npm run start` just run exit, not listening. #19

Open KevinZhang19870314 opened 12 months ago

KevinZhang19870314 commented 12 months ago

I follow the instruction https://github.com/nuejs/create-nue/issues/17, replace the whole package.json file, and run npm run start, it not listening port 8080, just exit. image

tipiirai commented 12 months ago

Try cloning the latest version from GitHub and try again. Should be fixed

KevinZhang19870314 commented 12 months ago

Try cloning the latest version from GitHub and try again. Should be fixed

Got this error:

D:\xxx\tmp\create-nue>npm run start

> create-nue@0.1.3 start
> npm run minify && npm run render && npm run compile && npm run serve

> create-nue@0.1.3 minify
> node ./scripts/minify.js

> create-nue@0.1.3 render
> node ./scripts/render.js

> create-nue@0.1.3 compile
> node ./scripts/compile.js

> create-nue@0.1.3 serve
> cd www && node ../scripts/server.js

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'D:\xxx\tmp\create-nue\scripts\server.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
KevinZhang19870314 commented 12 months ago

This is the package.json file copyed from #17,


{
  "name": "create-nue",
  "type": "module",
  "version": "0.1.3",
  "homepage": "https://github.com/nuejs/create-nue",
  "description": "A recommended way to start a Nue project",
  "repository": {
    "url": "https://github.com/nuejs/create-nue.git",
    "type": "git"
  },
  "bin": {
    "create-nue": "./scripts/init.js"
  },
  "scripts": {
    "start": "npm run minify && npm run render && npm run compile && npm run serve",
    "serve": "cd www && node ../scripts/server.js",
    "compile": "node ./scripts/compile.js",
    "minify": "node ./scripts/minify.js",
    "render": "node ./scripts/render.js"
  },
  "dependencies": {
    "nuejs-core": "^0.1.0",
    "js-yaml": "^4.1.0"
  }
}
```,

I fixed it by change this line `"serve": "cd www && node ../scripts/server.js",` to `"serve": "cd www && node ../scripts/serve.js",`, still got the beginning behaviour. Just run exit and not l;istening.
tipiirai commented 12 months ago

Try cloning the latest version according to the instructions: https://github.com/nuejs/create-nue#installation

Should work now.

iamkelv commented 12 months ago

I got this error after installing deps and runnin npm run start


> create-nue@0.1.3 start
> npm run minify && npm run render && npm run compile && npm run serve

> create-nue@0.1.3 minify
> node ./scripts/minify.js

> create-nue@0.1.3 render
> node ./scripts/render.js

> create-nue@0.1.3 compile
> node ./scripts/compile.js

> create-nue@0.1.3 serve
> cd www && node ../scripts/server.js

node:internal/modules/cjs/loader:949
  throw err;
  ^

Error: Cannot find module 'C:\Users\CYBER_GHOST\Desktop\DEVELOPMENT TOOLS\NUEJS\create-nue\scripts\server.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:946:15)
    at Module._load (node:internal/modules/cjs/loader:787:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.4.0

Here is my package.json code

{
  "name": "create-nue",
  "type": "module",
  "version": "0.1.3",
  "homepage": "https://github.com/nuejs/create-nue",
  "description": "A recommended way to start a Nue project",
  "repository": {
    "url": "https://github.com/nuejs/create-nue.git",
    "type": "git"
  },
  "bin": {
    "create-nue": "./scripts/init.js"
  },
  "scripts": {
    "start": "npm run minify && npm run render && npm run compile && npm run serve",
    "serve": "cd www && node ../scripts/server.js",
    "compile": "node ./scripts/compile.js",
    "minify": "node ./scripts/minify.js",
    "render": "node ./scripts/render.js"
  },
  "dependencies": {
    "nuejs-core": "^0.1.0",
    "js-yaml": "^4.1.0"
  }
}

Ask suggested by @tipiirai on https://github.com/nuejs/create-nue#installation