Code Monkey home page Code Monkey logo

Comments (14)

wengqianshan avatar wengqianshan commented on June 10, 2024

+1

from node-images.

joshmarinacci avatar joshmarinacci commented on June 10, 2024

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.

from node-images.

oxUnd avatar oxUnd commented on June 10, 2024

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

from node-images.

zhangyuanwei avatar zhangyuanwei commented on June 10, 2024

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

from node-images.

ijse avatar ijse commented on June 10, 2024

@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

> [email protected] 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

from node-images.

zhangyuanwei avatar zhangyuanwei commented on June 10, 2024

@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++扩展库吗?

from node-images.

ijse avatar ijse commented on June 10, 2024

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

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

[email protected] 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
···

from node-images.

zhangyuanwei avatar zhangyuanwei commented on June 10, 2024

@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来安装?

from node-images.

ijse avatar ijse commented on June 10, 2024

@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! [email protected] install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] 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

from node-images.

Meekohi avatar Meekohi commented on June 10, 2024
 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! [email protected] install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] 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

from node-images.

 avatar commented on June 10, 2024

I have same problem as @Meekohi

from node-images.

ijse avatar ijse commented on June 10, 2024

@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

from node-images.

shevchenhe avatar shevchenhe commented on June 10, 2024

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

from node-images.

276496815 avatar 276496815 commented on June 10, 2024

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

[email protected] 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! [email protected] install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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/

from node-images.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.