在服务器上部署React应用程序时出错

问题描述 投票:0回答:1

我在服务器上运行应用程序时遇到错误它正在本地工作我只需输入Run(npm start)并完全在本地运行。但我在服务器上做同样的事情我得到下面给出的错误。请有人帮助我。

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/”,“dependencies”:{“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“,”react-chartjs-2“:”^ 2.7.2“,”react-component-queries“:”^ 2.3.0“,”react-countdown -now“:”^ 2.1.0“,”react-countdown-to-future-date“:”0.0.3“,”react-d3-map“:”^ 0.8.3“,”react-dom“: “^ 16.4.1”,“react-ga”:“^ 2.5.3”,“react-icons”:“^ 2.2.7”,“react-infinite-calendar”:“^ 2.3.1”,“反应-notification-system“:”^ 0.2.17“,”react-router“:”^ 4.3.1“,”react-router-dom“:”^ 4.3.1“,”react-simple-maps“:” ^ 0.12.1“,”react-sizeme“:”^ 2.5.2“,”react-transition-group“:”^ 2.3.1“,”reactjs-countdown“:”0.0.8“,”reactstrap“: “^ 6.1.0”,“胜利”:“^ 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”:“react-scripts eject”}}

reactjs deployment windows-server npm-start run-script
1个回答
0
投票

我建议你查看你的package.json文件“start”脚本,或许将命令更改为:

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

我发现了和你一样的问题:https://github.com/creativetimofficial/ct-material-dashboard-pro-react/issues/69

© www.soinside.com 2019 - 2024. All rights reserved.