Closed Zooc closed 6 years ago
原因:项目依赖包node-sass没有安装完全 解决方法:npm install node-sass
run dev解决了,https://incoder.org/2018/03/27/rap2/
不过rap2-dolores成功运行后,依然出现以下错误提示:
Compiled successfully!
You can now view rap2-dolores in the browser.
Local: http://localhost:3000/ On Your Network: http://xxx.xx.x.xx:3000/
Note that the development build is not optimized. To create a production build, use npm run build.
The build failed because the process exited too early. This probably means the system ran out of memory or someone called kill -9
on the process.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rap2-dolores@1.0.0 start-js: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rap2-dolores@1.0.0 start-js 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! /root/.npm/_logs/2018-08-31T02_17_58_949Z-debug.log
ERROR: "start-js" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rap2-dolores@1.0.0 start: npm-run-all -p watch-css start-js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rap2-dolores@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! /root/.npm/_logs/2018-08-31T02_17_59_446Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rap2-dolores@1.0.0 dev: npm run start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rap2-dolores@1.0.0 dev 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! /root/.npm/_logs/2018-08-31T02_17_59_476Z-debug.log [root@VM_0_2_centos rap2-dolores]# [root@VM_0_2_centos rap2-dolores]#
【看了一下,内存是够用的】
total used free shared buff/cache available
Mem: 992 518 180 0 293 305 Swap: 0 0 0
8080端口依然可以访问,提示RAP2后端服务已启动,请从前端服务(rap2-dolores)访问。
请问以上错误如何解决?
原来是自己的内存不够,增加了swap内存后就好了。http://www.10tiao.com/html/371/201703/2669790609/1.html
BUG描述
standard --fix
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the rap2-dolores@1.0.0 linter 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! /root/.npm/_logs/2018-08-30T15_35_37_800Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! rap2-dolores@1.0.0 test:
npm run linter
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the rap2-dolores@1.0.0 test 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! /root/.npm/_logs/2018-08-30T15_35_37_821Z-debug.log
2.执行 npm run dev , 出现以下错误提示 fs.js:904 return binding.readdir(pathModule._makeLong(path), options.encoding); ^
Error: ENOENT: no such file or directory, scandir '/usr/src/rap2-dolores/node_modules/node-sass/vendor' at Object.fs.readdirSync (fs.js:904:18) at Object.getInstalledBinaries (/usr/src/rap2-dolores/node_modules/node-sass/lib/extensions.js:129:13) at foundBinariesList (/usr/src/rap2-dolores/node_modules/node-sass/lib/errors.js:20:15) at foundBinaries (/usr/src/rap2-dolores/node_modules/node-sass/lib/errors.js:15:5) at Object.module.exports.missingBinary (/usr/src/rap2-dolores/node_modules/node-sass/lib/errors.js:45:5) at module.exports (/usr/src/rap2-dolores/node_modules/node-sass/lib/binding.js:15:30) at Object. (/usr/src/rap2-dolores/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rap2-dolores@1.0.0 build-css:
node-sass src/ -o src/
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the rap2-dolores@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! /root/.npm/_logs/2018-08-30T15_36_53_584Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! rap2-dolores@1.0.0 watch-css:
npm run build-css && node-sass src/ -o src/ --watch --recursive
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the rap2-dolores@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! /root/.npm/_logs/2018-08-30T15_36_53_629Z-debug.log ERROR: "watch-css" exited with 1. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! rap2-dolores@1.0.0 start:
npm-run-all -p watch-css start-js
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the rap2-dolores@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! /root/.npm/_logs/2018-08-30T15_36_53_684Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! rap2-dolores@1.0.0 dev:
npm run start
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the rap2-dolores@1.0.0 dev 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! /root/.npm/_logs/2018-08-30T15_36_53_703Z-debug.log
复现步骤
期望结果
实际结果
截图
环境
附加信息