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"
}
}
}