Ошибка команды с кодом выхода 1. при попытке запустить пряжу - PullRequest
2 голосов
/ 24 марта 2019

Я учусь реагировать на ноды - я пытаюсь запустить сервер, так что я установил yarn, nodemon, express, но когда я пытаюсь запустить сообщение об ошибке, команда завершилась неудачно с кодом выхода 1.

моя ошибка

    PS D:\react project\ReactManagement-tutorial> yarn dev
yarn run v1.13.0
warning package.json: No license field
$ concurrently --kill-others-on-fail "yarn server" "yarn client"
warning package.json: No license field
warning package.json: No license field
$ nodemon server.js
$ cd client && yarn start
warning ..\package.json: No license field
$ react-scripts start
[1] 'react-scripts'��(��) ���� �Ǵ� �ܺ� ����, ���
��� �� �ִ� ���α׷�, �Ǵ�
[1] ��ġ ������ �ƴմϴ�.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
[1] yarn client exited with code 1
--> Sending SIGTERM to other processes..
[0] yarn server exited with code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS D:\react project\ReactManagement-tutorial>

my package.json - это

{
    "name": "management",
    "version": "1.0.0",
    "scripts": {
        "client": "cd client && yarn start",
        "server": "nodemon server.js",
        "dev": "concurrently --kill-others-on-fail \"yarn server\" \"yarn client\""
    },
    "dependencies": {
        "body-parser": "^1.18.3",
        "express": "^4.16.4",
        "nodemon": "^1.18.10"
    },
    "devDependencies": {
        "concurrently": "^4.1.0"
    }
}

и его мой server.js

const express = require('express');
const bodyParser = require('body-parser');  //서버모듈을위한 
const app = express();
const port = process.env.PORT || 5000;  

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

app.get('/api/hello',(req,res) =>{  
    res.send({message : 'hello express!'});  
});
app.listen(port,()=>console.log(`listening on port ${port}`))
...