Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OS X #8

Closed
akhoury opened this issue Apr 17, 2013 · 14 comments
Closed

Mac OS X #8

akhoury opened this issue Apr 17, 2013 · 14 comments

Comments

@akhoury
Copy link

akhoury commented Apr 17, 2013

[562] > npm install
npm WARN package.json img2pdf@0.0.1 No README.md file found!
npm http GET https://registry.npmjs.org/images
npm http 200 https://registry.npmjs.org/images
npm http GET https://registry.npmjs.org/images/-/images-1.1.3.tgz
npm http 200 https://registry.npmjs.org/images/-/images-1.1.3.tgz

images@1.1.3 install /Users/akhoury/code/img2pdf/node_modules/images
node install.js

CXX(target) Release/obj.target/images/src/Image.o
make: c++: No such file or directory
make: *** [Release/obj.target/images/src/Image.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:786:12)
gyp ERR! System Darwin 12.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/akhoury/code/img2pdf/node_modules/images
gyp ERR! node -v v0.10.3
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! images@1.1.3 install: node install.js
npm ERR! sh "-c" "node install.js" failed with 1
npm ERR!
npm ERR! Failed at the images@1.1.3 install script.
npm ERR! This is most likely a problem with the images package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls images
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/akhoury/code/img2pdf
npm ERR! node -v v0.10.3
npm ERR! npm -v 1.2.17
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/akhoury/code/img2pdf/npm-debug.log
npm ERR! not ok code 0

@wengqianshan
Copy link

+1

@joshmarinacci
Copy link

Same here, though for me it failed on Jpeg.o:

  CXX(target) Release/obj.target/images/src/Jpeg.o
../src/Jpeg.cc:14:10: fatal error: 'jpeglib.h' file not found
#include <jpeglib.h>
         ^
1 error generated.

I'm guessing certain native libs are required? The binding.gyp mentions something called libjpeg-turbo.

@oxUnd
Copy link
Collaborator

oxUnd commented May 14, 2013

need install turbojpeg
you can brew install jpeg-turbo install it.

@zhangyuanwei
Copy link
Owner

Does brew install jpeg-turbo work for you? @akhoury

@ijse
Copy link
Collaborator

ijse commented May 26, 2013

@zhangyuanwei

I've installed jpeg-turbo, but still fail to install images:

ijsetekiMacBook-Pro:Workspace ijse$ npm install images
npm http GET https://registry.npmjs.org/images
npm http 304 https://registry.npmjs.org/images

> images@1.1.3 install /Users/ijse/Workspace/node_modules/images
> node install.js

xcode-select: Error: No Xcode is selected. Use xcode-select -switch <path-to-xcode>, or see the xcode-select manpage (man xcode-select) for further information.

Traceback (most recent call last):
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp", line 18, in <module>
    sys.exit(gyp.main(sys.argv[1:]))
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in main
    return gyp_main(args)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 508, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2105, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 769, in Write
    self.Pchify))
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1154, in WriteSources
    cflags = self.xcode_settings.GetCflags(configname)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 260, in GetCflags
    sdk_root = self._SdkPath()
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 247, in _SdkPath
    return os.path.join(self._GetSdkBaseDir(),
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 234, in _GetSdkBaseDir
    raise Exception('Error %d running xcode-select' % job.returncode)
Exception: Error 2 running xcode-select
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:415:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 12.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ijse/Workspace/node_modules/images
gyp ERR! node -v v0.10.8
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

@zhangyuanwei
Copy link
Owner

@ijse 多谢,看样子是你的 xcode 环境配置有问题。
xcode-select: Error: No Xcode is selected. Use xcode-select -switch <path-to-xcode>, or see the xcode-select manpage (man xcode-select) for further information.
能用node-gyp编译其他C++扩展库吗?

@ijse
Copy link
Collaborator

ijse commented May 26, 2013

@zhangyuanwei 装了xcode和command line什么的,, 接着装:

···
npm http GET https://registry.npmjs.org/images
npm http 304 https://registry.npmjs.org/images

images@1.1.3 install /Users/ijse/Workspace/node_modules/images
node install.js

CXX(target) Release/obj.target/images/src/Image.o
CXX(target) Release/obj.target/images/src/Png.o
../src/Png.cc:10:10: fatal error: 'png.h' file not found
#include <png.h>
^
1 error generated.
make: *** [Release/obj.target/images/src/Png.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 12.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ijse/Workspace/node_modules/images
gyp ERR! node -v v0.10.8
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
···

@zhangyuanwei
Copy link
Owner

@ijse 已经成功编译一个.o文件了:
CXX(target) Release/obj.target/images/src/Image.o
编译Png.o的时候报错了,看样子缺少头文件,
../src/Png.cc:10:10: fatal error: 'png.h' file not found
非win32平台需要 giflib,jpeg-turbo,libpng,没有用过Mac,不过应该是类似brew install libpng来安装?

@ijse
Copy link
Collaborator

ijse commented May 27, 2013

@zhangyuanwei 嗯 嗯 ,, 今天来公司在Linux下试了下,也报这个错:

make: Entering directory `/home/webadmin/workspace/imgen/node_modules/images/build'
  CXX(target) Release/obj.target/images/src/Image.o
  CXX(target) Release/obj.target/images/src/Png.o
../src/Png.cc:10:17: 警告:png.h:没有那个文件或目录
../src/Png.cc:23: 错误:变量或字段 ‘read_from_memory’ 声明为 void
../src/Png.cc:23: 错误:‘png_structp’ 在此作用域中尚未声明
../src/Png.cc:23: 错误:‘png_bytep’ 在此作用域中尚未声明
../src/Png.cc:23: 错误:‘png_size_t’ 在此作用域中尚未声明
../src/Png.cc:23: 错误:initializer 表达式列表被看作复合表达式
../src/Png.cc:23: 错误:expected ‘,’ or ‘;’ before ‘{’ token
make: *** [Release/obj.target/images/src/Png.o] 错误 1
make: Leaving directory `/home/webadmin/workspace/imgen/node_modules/images/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/webadmin/prog/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:255:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Linux 2.6.18-194.el5
gyp ERR! command "node" "/home/webadmin/prog/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/webadmin/workspace/imgen/node_modules/images
gyp ERR! node -v v0.8.18
gyp ERR! node-gyp -v v0.8.2
gyp ERR! not ok 
npm ERR! images@1.1.3 install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 1
npm ERR! 
npm ERR! Failed at the images@1.1.3 install script.
npm ERR! This is most likely a problem with the images package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls images
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.18-194.el5
npm ERR! command "/home/webadmin/prog/node/bin/node" "/home/webadmin/prog/node/bin/npm" "install" "images"
npm ERR! cwd /home/webadmin/workspace/imgen
npm ERR! node -v v0.8.18
npm ERR! npm -v 1.2.2
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/webadmin/workspace/imgen/npm-debug.log
npm ERR! not ok code 0

@Meekohi
Copy link

Meekohi commented Jul 18, 2013

 CXX(target) Release/obj.target/images/src/Image.o
  CXX(target) Release/obj.target/images/src/Png.o
  CXX(target) Release/obj.target/images/src/Jpeg.o
../src/Jpeg.cc:73:26: error: use of undeclared identifier 'JCS_EXT_RGBA'
        cinfo.out_color_space = JCS_EXT_RGBA;
                                ^
../src/Jpeg.cc:121:25: error: use of undeclared identifier 'JCS_EXT_RGBA'
        cinfo.in_color_space = JCS_EXT_RGBA;
                               ^
2 errors generated.
make: *** [Release/obj.target/images/src/Jpeg.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/0.8.20/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:255:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Darwin 12.4.0
gyp ERR! command "node" "/usr/local/Cellar/node/0.8.20/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/meekohi/aball.web/spin-transcoder/node_modules/images
gyp ERR! node -v v0.8.20
gyp ERR! node-gyp -v v0.8.4
gyp ERR! not ok 
npm ERR! images@1.1.3 install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 1
npm ERR! 
npm ERR! Failed at the images@1.1.3 install script.
npm ERR! This is most likely a problem with the images package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls images
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.4.0
npm ERR! command "/usr/local/Cellar/node/0.8.20/bin/node" "/usr/local/bin/npm" "update"
npm ERR! cwd /Users/meekohi/aball.web/spin-transcoder
npm ERR! node -v v0.8.20
npm ERR! npm -v 1.2.11
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/meekohi/aball.web/spin-transcoder/npm-debug.log
npm ERR! not ok code 0

@ghost
Copy link

ghost commented Dec 18, 2013

I have same problem as @Meekohi

@ijse
Copy link
Collaborator

ijse commented Dec 18, 2013

@pRockrammer

  1. make sure you've installed xcode command line tool
  2. remove ~/.node-gyp and try install node-images again
  3. try update your node to v0.10.23

Good Luck!

ps: if still fail, try gm

@shevchenhe
Copy link

I also got the same problem as @Meekohi . Can any one give some solutions?

@276496815
Copy link

I install images , but it is have two question .
it is this
barcode npm install images
npm http GET https://registry.npmjs.org/images
npm http 304 https://registry.npmjs.org/images

images@1.1.3 install /Users/zhangzhao/Desktop/node/node_modules/images
node install.js

CXX(target) Release/obj.target/images/src/Image.o
CXX(target) Release/obj.target/images/src/Png.o
CXX(target) Release/obj.target/images/src/Jpeg.o
../src/Jpeg.cc:73:26: error: use of undeclared identifier 'JCS_EXT_RGBA'
cinfo.out_color_space = JCS_EXT_RGBA;
^
../src/Jpeg.cc:121:25: error: use of undeclared identifier 'JCS_EXT_RGBA'
cinfo.in_color_space = JCS_EXT_RGBA;
^
2 errors generated.
make: *** [Release/obj.target/images/src/Jpeg.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/Cellar/node/0.10.25/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Darwin 13.1.0
gyp ERR! command "node" "/usr/local/Cellar/node/0.10.25/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/zhangzhao/Desktop/node/node_modules/images
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! images@1.1.3 install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the images@1.1.3 install script.
npm ERR! This is most likely a problem with the images package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls images
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.1.0
npm ERR! command "/usr/

@oxUnd oxUnd closed this as completed Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants