Node.js 在节点后端运行npm run dev时出现问题

Node.js 在节点后端运行npm run dev时出现问题,node.js,reactjs,stripe-payments,backend,Node.js,Reactjs,Stripe Payments,Backend,我尝试用node构建API,我的前端在名为client的文件夹中分开,这个filepackage.json、server.js在我的项目根文件夹中。 当我想要npm运行dev时,它会给我以下错误: npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! clothing-server@1.0.0 dev: `concurrently --kill-others-on-fail "npm server" "npm client"` npm ERR! E

我尝试用node构建API,我的前端在名为client的文件夹中分开,这个filepackage.json、server.js在我的项目根文件夹中。 当我想要npm运行dev时,它会给我以下错误:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! clothing-server@1.0.0 dev: `concurrently --kill-others-on-fail "npm server" "npm client"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the clothing-server@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
这是我的server.js:

const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const path = require('path');

if (process.env.NODE_ENV !== 'production') require('dotenv').config();

const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);

const app = express();

const port = process.env.PORT || 5000;

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(cors());

if (process.env.NODE_ENV === 'production') {
  app.use(express.static(path.join(__dirname, 'client/build')));

  app.get('*', function(req, res) {
    res.sendFile(path.join(__dirname, 'client/build', 'index.html'));
  });
}
app.listen(port, error => {
  if (error) throw error;
  console.log(`Server running on ${port}`);
});

app.post('/payment', (req, res) => {
  const body = {
    source: req.body.token.id,
    amount: req.body.amount,
    currency: 'usd'
  };
  stripe.charges.create(body, (stripeErr, stripeRes) => {
    if (stripeErr) {
      res.status(500).send({ error: stripeErr });
    } else {
      res.status(200).send({ error: stripeRes });
    }
  });
});
和my package.json:

 {
  "name": "clothing-server",
  "version": "1.0.0",
  "engines": {
    "node": "10.16.0",
    "npm": "6.9.0"
  },
  "scripts": {
    "client": "cd client && npm start",
    "server": "nodemon server.js",
    "build": "cd client && npm run build",
    "dev": "concurrently --kill-others-on-fail \"npm server\" \"npm client\"",
    "start": "node server.js",
    "heroku-postbuild": "cd client && npm install && npm install --only=dev --no-shrinkwrap && npm run build"
  },
  "dependencies": {
    "body-parser": "^1.19.0",
    "compression": "1.7.4",
    "cors": "2.8.5",
    "dotenv": "8.2.0",
    "express": "^4.17.1",
    "stripe": "8.6.0"
  },
  "devDependencies": {
    "concurrently": "^5.0.2"
  }
}
我尝试删除我的锁文件、节点单元模块和npm缓存清理,但它们没有帮助

您的npm运行开发脚本调用npm服务器,它尝试调用nodemon server.js,但显然您的项目中没有安装nodemon。查看依赖项列表,安装nodemon,或将其从服务器脚本中删除。
显然它应该起作用

在package.json文件中,应该是
开发人员:并发-在失败时杀死其他人\npm run server\\npm run client\

我已全局安装,但仍然收到相同的错误: