2017-09-07 1 views
0

AWS Centos 7 상자에서 fabricjs를 설치하고 Angular 4 웹 앱에서 작업하는 데 어려움을 겪고 있습니다. CentOS 7에 대한 나의 이해를 초월하는 시스템 라이브러리 문제로 뛰어 들어라. 누구든지이 과거를 어떻게 얻었는지에 대한 제안이 있다면! 그것은 내가 가치가 무엇인지에 대한 Centos 7 노드 canvas/fabricjs 컴파일 오류

npm install fabric --save 

> [email protected] install /data/ng-app/node_modules/canvas 
> node-gyp rebuild 

make: Entering directory `/data/ng-app/node_modules/canvas/build' 
    SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node 
    COPY Release/canvas-postbuild.node 
    CXX(target) Release/obj.target/canvas/src/Canvas.o 
In file included from ../src/Canvas.cc:20:0: 
../src/JPEGStream.h:10:21: fatal error: jpeglib.h: No such file or directory 
#include <jpeglib.h> 
        ^
compilation terminated. 
make: *** [Release/obj.target/canvas/src/Canvas.o] Error 1 
make: Leaving directory `/data/ng-app/node_modules/canvas/build' 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 
gyp ERR! stack  at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/build.js:276:23) 
gyp ERR! stack  at emitTwo (events.js:106:13) 
gyp ERR! stack  at ChildProcess.emit (events.js:191:7) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) 
gyp ERR! System Linux 3.10.0-327.36.1.el7.x86_64 
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /data/ng-app/node_modules/canvas 
gyp ERR! node -v v6.11.1 
gyp ERR! node-gyp -v v3.4.0 
gyp ERR! not ok 
[email protected] /data/ng-app 
├── UNMET PEER DEPENDENCY @angular/[email protected] 
├── UNMET PEER DEPENDENCY @angular/[email protected] 
├── UNMET PEER DEPENDENCY @angular/[email protected] 
└── [email protected] 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules/chokidar/node_modules/fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) 
npm WARN [email protected] requires a peer of @angular/[email protected]>=4.0.0 <5.0.0 || >=4.0.0-beta <5.0.0 but none was installed. 
npm WARN [email protected] requires a peer of @angular/[email protected]^4.0.0 but none was installed. 
npm WARN [email protected] requires a peer of @angular/[email protected]^2.3.1 || >=4.0.0-beta <5.0.0 but none was installed. 
npm WARN [email protected] requires a peer of @angular/[email protected]^2.3.1 || >=4.0.0-beta <5.0.0 but none was installed. 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/canvas): 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild` 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1 
[[email protected] ng-app]$ exit 
logout 

설치 참조 라이브러리를 갖고있는 것 같다하지만 확신 할 수 없다 :

# yum install libjpeg 
Loaded plugins: fastestmirror 
Loading mirror speeds from cached hostfile 
* base: centos.mirror.constant.com 
* epel: s3-mirror-us-east-1.fedoraproject.org 
* extras: mirror.lug.udel.edu 
* updates: mirror.trouble-free.net 
Package libjpeg-turbo-1.2.90-5.el7.x86_64 already installed and latest version 
Nothing to do 

답변

2

당신은 설치 해당 라이브러리의 개발 버전이 필요합니다. 노드 캔버스 제안 무엇 은 다음과 같습니다

sudo yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel giflib-devel 

당신이, 당신은 여전히 ​​CDN에서 참조 할 수 있습니다, NPM에서 설치하지 않아도 브라우저에서 각도에서 fabricjs를 사용하려는 경우이 방법으로 쉽게 아마도 배포 시간이 줄어들 것입니다.