node.js - npm install canvas dies with "clang: error: no such file or directory: '{{}'" -
i error while installing node packages run node-gyp rebuild
:
solink_module(target) release/canvas-postbuild.node clang: error: no such file or directory: '{{}' make: *** [release/canvas-postbuild.node] error 1 gyp err! build error gyp err! stack error: `make` failed exit code: 2 gyp err! stack @ childprocess.onexit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp err! stack @ childprocess.emit (events.js:98:17) gyp err! stack @ process.childprocess._handle.onexit (child_process.js:810:12) gyp err! system darwin 14.0.0 gyp err! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp err! cwd /users/arkadiy/node-canvas gyp err! node -v v0.10.33 gyp err! node-gyp -v v1.0.1 gyp err! not ok
i have npm 1.4.28 , of /usr/local chowned me. clang recent-ish:
apple llvm version 6.0 (clang-600.0.54) (based on llvm 3.5svn) target: x86_64-apple-darwin14.0.0 thread model: posix
the error ungoogleable (seriously, try it) , can't tell clang being invoked because stack trace callback handler. seems shell substitution/xargs issue almost?
i node/npm install suspect. if start github
https://github.com/automattic/node-canvas
and download repo
git clone https://github.com/automattic/node-canvas.git cd node-canvas npm install .
notice period in above command - gets upstream dependencies
i did , - if errors doing above suggest expunge node/npm , install source. following steps give such clean node/npm install source
to start fresh remove prior node , npm installs these :
sudo mv ~/.npmrc ~/.npmrc_ignore sudo mv ~/.npm ~/.npm_ignore sudo mv ~/tmp ~/tmp_ignore sudo mv ~/.npm-init.js ~/.npm-init.js_ignore
download source : http://nodejs.org/download/
cd node-v0.10.33
define environment variable node_path dir subsequent module installs
export node_parent=/some/desired/install/path_goes_here export node_parent=/usr/local/bin/nodejs # use if must install root (sudo) export node_parent=${home}/nodejs-v0.10.33 # use if want install modules export path=${node_parent}/bin:${path} export node_path=${node_parent}/lib/node_modules ./configure --prefix=${node_parent} make make install
which puts dir defined above --prefix
when use syntax : npm install -g some_cool_module -g global installs dir $node_path , not $pwd
important put above 3 export xxx=yyy commands ~/.bashrc or such persist these environment variable changes
Comments
Post a Comment