我被 npm --prefix 困住了。 我正在尝试为我的前端文件夹添加前缀,以便我可以同时运行后端和前端。
我不断收到错误路径的错误: ackend rontend/package.json.
有人可以帮我吗?
{
"name": "backend",
"version": "1.0.0",
"description": "User Authentication APP - MERN stack",
"main": "server.js",
"scripts": {
"start": "node backend/server.js",
"server": "nodemon backend/server.js",
"client": "npm start --prefix frontend ",
"dev": "concurrently \"npm run server\" \"npm run client\""
}
}
你可以测试这个package.json
"scripts": {
"server": "npm run watch --prefix server",
"client": "npm start --prefix client",
"watch": "npm run server & npm run client"
}
然后运行
npm run watch