当前位置: 首页 > 知识库问答 >
问题:

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

易祖鹤
2023-03-14

我在服务器上运行应用程序时出错,它在本地正常工作,我只需输入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! 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

{“name”:“chakde11”,“version”:“1.0.0”,“private”:false,“homepage”:http://chakde11.com/“,”依赖项“{bootstrap:“4.1.1”,“chart.js:“^2.7.2”,“类名:“^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”,“道具类型:”^15.6.2”,“react:“^0.14.9”,“react-chartjs-2:”^2.7.2”,“react组件查询“^3.0”,“react”倒计时“^2:”^2.1.0,“反应到未来日期的倒计时”:“0.0.3”,“反应-d3-map”:“^0.8.3”,“反应dom”:“^16.4.1”,“反应ga”:“^2.5.3”,“反应图标”:“^2.2.7”,“反应无限日历”:“^2.3.1”,“反应通知系统”:“^0.2.17”,“反应路由器”:“^4.3.1”,“反应路由器dom”:“^4.3.1”,“反应简单地图”:“^0.12.1”,“反应大小”:“^2.5.2”,”react过渡组“^2.3.1”,“reactjs倒计时“^0.0.8”,“reactstrap“^6.1.0”,“victory“^0.27.1”),“devDependencies“{”gh pages“^1.2.0”,“node sass chokidar“^1.3.4”,“npm运行全部“^4.1.3”,“react脚本“^1.1.4”,“serve“^9.1.0”,“stylelint“^9.3.0”,“stylelint配置推荐的scss“^3.2.0”,“scss”stylelint配置标准“^18.2.0”,“stylelint顺序“^0.8.1”,“stylelint scss:“^3.1.3”,脚本“{”构建css“:“节点sass chokidar--包含路径。/src--包含路径。/node_模块src/-o src/”,“监视css”:“npm运行构建css”

共有1个答案

胡浩瀚
2023-03-14

我建议你检查一下你的包裹。json文件“启动”脚本,并可能将命令更改为:

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

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

 类似资料:
  • 我有一个使用Tomcat服务器部署的JSF应用程序,它在Tomcat 7中完美运行。但是现在我需要部署非常应用程序Weblogic我将其部署到weblogic,但是在显示主页后,我尝试打开的任何链接我都会在我的应用程序中显示错误页面。 我使用JPA作为我的持久性API来连接到数据库。 Weblogic堆栈跟踪 我无法理解我是weblogic的新手请帮忙

  • 由于我在Spring Boot项目中添加了Hateoas依赖项并部署在weblogic Server12c上,因此我面临这个问题 启动ApplicationContext时出错。若要显示条件报告,请在启用“调试”的情况下重新运行应用程序。2020-01-09 14:18:53,591错误org.springframework.boot.diagnostics.loggingfailureanaly

  • 我在Azure上的Linux应用服务上部署了一个响应js网站。但它没有部署在应用服务上。我使用pm2命令在linux环境下运行应用程序 pm2 serve/home/site/wwwroot/--无守护进程 但在错误日志中,未找到pm2的错误。接下来呢 容器没有响应端口: 8080上的HTTP ping,站点启动失败。 站点的容器已退出,站点启动失败

  • 我正试图在tomcat服务器上部署spring boot应用程序,但遇到严重错误[http-nio-8080-exec-5]org.apache.catalina.startup.hostconfig.deploywar部署web应用程序存档时出错

  • 当我在glassfish 4.1中部署war文件时,会出现以下异常

  • 问题内容: 我有一个dist文件夹,其中包含CSS,字体,JS文件夹和一个针对Vue.js最小化的文件,可以部署和使用。我想使用Node.js运行此应用程序。 如何将其设置为仅运行并将其部署在请求的特定端口上?不知道如何构建它,或者不确定是否需要以特定方式构建它以运行此Vue应用程序。任何帮助将不胜感激。 问题答案: 由于Vue只是一个前端库,因此托管它和执行诸如提供资产之类的最简单方法是创建一个