Address localhost:3000 is already in use

直接在package.json里面去加一段

  "config": {
        "nuxt": {
            "host": "0.0.0.0",
            "port": "3333" //你就写与冲突的端口号不同的就行
        }
    }

完整的

{
    "name": "firstproject",
    "version": "1.0.0",
    "description": "test",
    "author": "gaby",
    "private": true,
    "scripts": {
        "dev": "nuxt --open",
        "build": "nuxt build",
        "start": "nuxt start",
        "generate": "nuxt generate",
        "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
        "precommit": "npm run lint"
    },
    "dependencies": {
        "axios": "^0.19.2",
        "nuxt": "^2.0.0"
    },
    "devDependencies": {
        "babel-eslint": "^10.0.1",
        "eslint": "^4.19.1",
        "eslint-friendly-formatter": "^4.0.1",
        "eslint-loader": "^2.1.1",
        "eslint-plugin-vue": "^4.0.0"
    },
    "config": {  // here are the changes
        "nuxt": {
            "host": "0.0.0.0",
            "port": "3333"
        }
    }
}
posted on 2020-03-18 14:07  周小姐你好  阅读(5343)  评论(0编辑  收藏  举报