Fabric.js: Installation fails with node 7.5.0

Created on 8 Feb 2017  路  5Comments  路  Source: fabricjs/fabric.js

Version

1.7.3

Test Case

````
root@df1997d3e74a:/opt/test# npm install

[email protected] install /opt/test/node_modules/canvas
node-gyp rebuild

./util/has_lib.sh: 31: ./util/has_lib.sh: pkg-config: not found
gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
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:308:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:192:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.9.4-moby
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/test/node_modules/canvas
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

[email protected] install /opt/test/node_modules/contextify
node-gyp rebuild

make: Entering directory '/opt/test/node_modules/contextify/build'
CXX(target) Release/obj.target/contextify/src/contextify.o
../src/contextify.cc: In static member function 'static v8::Local ContextWrap::createV8Context(v8::Local)':
../src/contextify.cc:131:68: warning: 'v8::Local v8::Function::NewInstance() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
Local wrapper = Nan::New(constructor)->NewInstance();
^
In file included from /root/.node-gyp/7.5.0/include/node/v8.h:26:0,
from /root/.node-gyp/7.5.0/include/node/node.h:42,
from ../src/contextify.cc:1:
/root/.node-gyp/7.5.0/include/node/v8.h:3292:52: note: declared here
V8_DEPRECATED("Use maybe version", Local NewInstance() const);
^
/root/.node-gyp/7.5.0/include/node/v8config.h:329:3: note: in definition of macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/contextify.cc:150:16: error: 'class v8::ObjectTemplate' has no member named 'SetAccessCheckCallbacks'
otmpl->SetAccessCheckCallbacks(GlobalPropertyNamedAccessCheck,
^
../src/contextify.cc: In static member function 'static void ContextWrap::GlobalPropertyGetter(v8::Local, const Nan::PropertyCallbackInfo&)':
../src/contextify.cc:182:80: warning: 'v8::Local v8::Object::GetRealNamedProperty(v8::Local)' is deprecated: Use maybe version [-Wdeprecated-declarations]
Local rv = Nan::New(ctx->sandbox)->GetRealNamedProperty(property);
^
In file included from /root/.node-gyp/7.5.0/include/node/v8.h:26:0,
from /root/.node-gyp/7.5.0/include/node/node.h:42,
from ../src/contextify.cc:1:
/root/.node-gyp/7.5.0/include/node/v8.h:2949:30: note: declared here
Local GetRealNamedProperty(Local key));
^
/root/.node-gyp/7.5.0/include/node/v8config.h:329:3: note: in definition of macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/contextify.cc: In static member function 'static void ContextWrap::GlobalPropertyQuery(v8::Local, const Nan::PropertyCallbackInfo&)':
../src/contextify.cc:209:67: warning: 'v8::Local v8::Object::GetRealNamedProperty(v8::Local)' is deprecated: Use maybe version [-Wdeprecated-declarations]
if (!Nan::New(ctx->sandbox)->GetRealNamedProperty(property).IsEmpty() ||
^
In file included from /root/.node-gyp/7.5.0/include/node/v8.h:26:0,
from /root/.node-gyp/7.5.0/include/node/node.h:42,
from ../src/contextify.cc:1:
/root/.node-gyp/7.5.0/include/node/v8.h:2949:30: note: declared here
Local GetRealNamedProperty(Local key));
^
/root/.node-gyp/7.5.0/include/node/v8config.h:329:3: note: in definition of macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/contextify.cc:210:71: warning: 'v8::Local v8::Object::GetRealNamedProperty(v8::Local)' is deprecated: Use maybe version [-Wdeprecated-declarations]
!Nan::New(ctx->proxyGlobal)->GetRealNamedProperty(property).IsEmpty()) {
^
In file included from /root/.node-gyp/7.5.0/include/node/v8.h:26:0,
from /root/.node-gyp/7.5.0/include/node/node.h:42,
from ../src/contextify.cc:1:
/root/.node-gyp/7.5.0/include/node/v8.h:2949:30: note: declared here
Local GetRealNamedProperty(Local key));
^
/root/.node-gyp/7.5.0/include/node/v8config.h:329:3: note: in definition of macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
contextify.target.mk:94: recipe for target 'Release/obj.target/contextify/src/contextify.o' failed
make: * [Release/obj.target/contextify/src/contextify.o] Error 1
make: Leaving directory '/opt/test/node_modules/contextify/build'
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:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:192:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.9.4-moby
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/test/node_modules/contextify
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
[email protected] /opt/test
-- [email protected] -- [email protected]

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
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/contextify):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
root@df1997d3e74a:/opt/test#
```

All 5 comments

yes.
as you can see node is supported up to 6.
That is because of jsdom that we need to support node 0.12

Ah ok, but we use fabricjs on the client (browser) and only use npm as the package manager. It's an optional dependency, but the installation crashes the whole npm installation. Should that be the case?

Thanks!

sadly yes.
There is an open issue about what to do with this dependencies.
npm does not handle this optional very good.
You can try to install with --no-optional and it should no crash.

oh okay :-/, thanks!

If you do not mind installing a bunch of dependencies, check this installation on node-canvas

Was this page helpful?
0 / 5 - 0 ratings