简体   繁体   中英

Can anyone help me with npm --prefix?

I'm stuck with npm --prefix. I'm trying to prefix my frontend folder so I can run both the backend and frontend at the same time.

I keep getting an error with the wrong pathway: \backend\frontend/package.json.

Can anyone help me with that?

{
      "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\""
      }
    }
You can test this package.json
 "scripts": {
    "server": "npm run watch --prefix server",
    "client": "npm start --prefix client",
    "watch": "npm run server & npm run client"
}

-> npm run watch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM