Ошибка при развертывании приложения React на сервере

Я получаю сообщение об ошибке при запуске приложения на сервере, оно работает правильно на локальном компьютере, я просто ввожу «Выполнить» (запуск npm) и отлично работает на локальном компьютере. но то же самое, что я делаю на сервере, я получаю ошибку, указанную ниже. пожалуйста, помогите мне.

SyntaxError: Unexpected end of input
    at new Script (vm.js:74:7)
    at createScript (vm.js:246:10)
    at Object.runInThisContext (vm.js:298:10)
    at Module._compile (internal/modules/cjs/loader.js:646:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (internal/modules/cjs/helpers.js:20:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-css: `node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build-css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-03-30T06_54_54_535Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch-css: `npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch-css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-03-30T06_54_54_566Z-debug.log
ERROR: "watch-css" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm-run-all -p watch-css start-js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-03-30T06_54_54_800Z-debug.log

{"name": "chakde11", "version": "1.0.0", "private": false, "homepage": "http://chakde11.com/ "," зависимости ": {" bootstrap ":" 4.1.1 "," chart.js ":" ^ 2.7.2 "," classnames ":" ^ 2.2 .6 "," d3-geo ":" ^ 1.10.0 "," dateformat ":" ^ 3.0.3 "," faker ":" ^ 4.1.0 "," jsx ":" ^ 0.9.89 ", «npm»: «^ 6.9.0», «package.json»: «^ 2.0.1», «prop-types»: «^ 15.6.2», «реагировать»: «^ 0.14.9», «реагировать -chartjs-2 ":" ^ 2.7.2 "," response-component-questions ":" ^ 2.3.0 "," response-countdown-now ":" ^ 2.1.0 "," response-countdown-to- future-date ":" 0.0.3 "," react-d3-map ":" ^ 0.8.3 "," react-dom ":" ^ 16.4.1 "," react-ga ":" ^ 2.5.3 "," response-icons ":" ^ 2.2.7 "," react-infinite-calendar ":" ^ 2.3.1 "," react-notification-system ":" ^ 0.2.17 "," response-router " : "^ 4.3.1", "react-router-dom": "^ 4.3.1", "react-simple-maps": "^ 0.12.1", "react-sizeme": "^ 2.5.2" , "реакция-переход-группа": "^ 2.3.1", "re actjs-countdown ":" 0.0.8 "," reactstrap ":" ^ 6.1.0 "," victory ":" ^ 0.27.1 "}," devDependencies ": {" gh-pages ":" ^ 1.2.0 "," node-sass-chokidar ":" ^ 1.3.4 "," npm-run-all ":" ^ 4.1.3 "," react-scripts ":" 1.1.4 "," serve ":" ^ 9.1.0 "," stylelint ":" ^ 9.3.0 "," stylelint-config-Recommended-scss ":" ^ 3.2.0 "," stylelint-config-standard ":" ^ 18.2.0 "," stylelint -order ":" ^ 0.8.1 "," stylelint-scss ":" ^ 3.1.3 "}," scripts ": {" build-css ":" node-sass-chokidar --include-path ./src --include-path ./node_modules src / -o src / "," watch-css ":" npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src / -o src / --watch --recursive "," start-js ":" react-scripts start "," start ":" npm-run-all -p watch-css start-js "," build " : «npm run build-css && react-scripts build», «serve»: «serve -s build», «deploy»: «gh-pages -d build», «test»: «react-scripts test --env = jsdom "," eject ":" реагировать на извлечение скриптов " }}


person Rahul Kumar    schedule 30.03.2019    source источник
comment
Какой у вас сценарий сборки? Вы развернули свой статический сайт на сервере или просто запускали скрипты узла? Вы запускаете npm install?   -  person MattYao    schedule 30.03.2019
comment
Я запускаю npm install, затем npm start внутри папки домена. да, я развертываю статический сайт на сервере, мне нужно изменить какой-либо файл или код? Я изменил домашнюю страницу: '' MyURL в файле package.json.   -  person Rahul Kumar    schedule 30.03.2019
comment
Вероятно, вам нужно опубликовать файл package.json.   -  person MattYao    schedule 30.03.2019
comment
да, я только что добавил код package.json под вопросом   -  person Rahul Kumar    schedule 30.03.2019
comment
@MattYao, я разместил свой package.json.   -  person Rahul Kumar    schedule 15.04.2019


Ответы (1)


Я предлагаю вам проверить сценарий запуска вашего файла package.json и, возможно, изменить команду на:

"start": "NODE_PATH=./src npm-run-all -p watch-css start-js",

Я обнаружил ту же проблему, что и ваша: https://github.com/creativetimofficial/ct-material-dashboard-pro-react/issues/69

person MattYao    schedule 30.03.2019