1

在服务器上运行应用程序时遇到错误 它在本地正常工作我只需输入运行(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! chakde11@1.0.0 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 chakde11@1.0.0 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! chakde11@1.0.0 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 chakde11@1.0.0 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! chakde11@1.0.0 start: `npm-run-all -p watch-css start-js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chakde11@1.0.0 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

{“名称”:“chakde11”,“版本”:“1.0.0”,“私人”:假,“主页”:“ 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”、“包.json”:“^2.0.1”,“prop-types”:“^15.6.2”,“react”:“^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”、“react -通知系统”:“^0.2.17”,“反应路由器”:“^4.3.1”,“反应路由器-dom”:“^4.3.1”,“反应简单地图”:“ ^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", "反应脚本”:“1.1.4”,“服务”:“^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”},“脚本”:{“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 ", "弹出": "反应脚本弹出" } }

4

1 回答 1

0

我建议您检查您的 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

于 2019-03-30T11:01:54.623 回答