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

Compatible with nodejs 11? #83

Closed
hilookas opened this issue Mar 25, 2019 · 3 comments
Closed

Compatible with nodejs 11? #83

hilookas opened this issue Mar 25, 2019 · 3 comments

Comments

@hilookas
Copy link

I tried to install and require fs-ext to use flock on nodejs 11, but it seems like I have some trouble.

Here are some warnings during the process of installation.

$ npm i fs-ext

> fs-ext@1.2.1 install /home/ubuntu/test/node_modules/fs-ext
> node-gyp configure build

make: Entering directory '/home/ubuntu/test/node_modules/fs-ext/build'
  CXX(target) Release/obj.target/fs-ext/fs-ext.o
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flock(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:350:40: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   flock_data->fd = info[0]->Int32Value();
                                        ^
In file included from /root/.node-gyp/11.12.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.12.0/include/node/node.h:63,
                 from ../fs-ext.cc:20:
/root/.node-gyp/11.12.0/include/node/v8.h:2572:46: note: declared here
   V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
                                              ^
/root/.node-gyp/11.12.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../fs-ext.cc:351:42: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   flock_data->oper = info[1]->Int32Value();
                                          ^
In file included from /root/.node-gyp/11.12.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.12.0/include/node/node.h:63,
                 from ../fs-ext.cc:20:
/root/.node-gyp/11.12.0/include/node/v8.h:2572:46: note: declared here
   V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
                                              ^
/root/.node-gyp/11.12.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Seek(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:401:32: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   int fd = info[0]->Int32Value();
                                ^
In file included from /root/.node-gyp/11.12.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.12.0/include/node/node.h:63,
                 from ../fs-ext.cc:20:
/root/.node-gyp/11.12.0/include/node/v8.h:2572:46: note: declared here
   V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
                                              ^
/root/.node-gyp/11.12.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../fs-ext.cc:386:74: warning: ‘double v8::Value::NumberValue() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   if (!(a)->IsUndefined() && !(a)->IsNull() && !IsInt64((a)->NumberValue())) { \
                                                                          ^
../fs-ext.cc:402:3: note: in expansion of macro ‘ASSERT_OFFSET’
   ASSERT_OFFSET(info[1]);
   ^
In file included from /root/.node-gyp/11.12.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.12.0/include/node/node.h:63,
                 from ../fs-ext.cc:20:
/root/.node-gyp/11.12.0/include/node/v8.h:2569:45: note: declared here
   V8_DEPRECATED("Use maybe version", double NumberValue() const);
                                             ^
/root/.node-gyp/11.12.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../fs-ext.cc:389:60: warning: ‘int64_t v8::Value::IntegerValue() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 #define GET_OFFSET(a) ((a)->IsNumber() ? (a)->IntegerValue() : -1)
                                                            ^
../fs-ext.cc:403:16: note: in expansion of macro ‘GET_OFFSET’
   off_t offs = GET_OFFSET(info[1]);
                ^
In file included from /root/.node-gyp/11.12.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.12.0/include/node/node.h:63,
                 from ../fs-ext.cc:20:
/root/.node-gyp/11.12.0/include/node/v8.h:2570:46: note: declared here
   V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
                                              ^
/root/.node-gyp/11.12.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../fs-ext.cc:404:36: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   int whence = info[2]->Int32Value();
                                    ^
In file included from /root/.node-gyp/11.12.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.12.0/include/node/node.h:63,
                 from ../fs-ext.cc:20:
/root/.node-gyp/11.12.0/include/node/v8.h:2572:46: note: declared here
   V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
                                              ^
/root/.node-gyp/11.12.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Fcntl(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:443:32: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   int fd = info[0]->Int32Value();
                                ^
In file included from /root/.node-gyp/11.12.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.12.0/include/node/node.h:63,
                 from ../fs-ext.cc:20:
/root/.node-gyp/11.12.0/include/node/v8.h:2572:46: note: declared here
   V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
                                              ^
/root/.node-gyp/11.12.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../fs-ext.cc:444:33: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   int cmd = info[1]->Int32Value();
                                 ^
In file included from /root/.node-gyp/11.12.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.12.0/include/node/node.h:63,
                 from ../fs-ext.cc:20:
/root/.node-gyp/11.12.0/include/node/v8.h:2572:46: note: declared here
   V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
                                              ^
/root/.node-gyp/11.12.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../fs-ext.cc:445:33: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   int arg = info[2]->Int32Value();
                                 ^
In file included from /root/.node-gyp/11.12.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.12.0/include/node/node.h:63,
                 from ../fs-ext.cc:20:
/root/.node-gyp/11.12.0/include/node/v8.h:2572:46: note: declared here
   V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
                                              ^
/root/.node-gyp/11.12.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE StatVFS(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:479:42: warning: ‘v8::Local<v8::String> v8::Value::ToString() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   Nan::Utf8String path(info[0]->ToString());
                                          ^
In file included from /root/.node-gyp/11.12.0/include/node/node.h:63:0,
                 from ../fs-ext.cc:20:
/root/.node-gyp/11.12.0/include/node/v8.h:10251:15: note: declared here
 Local<String> Value::ToString() const {
               ^
  SOLINK_MODULE(target) Release/obj.target/fs-ext.node
  COPY Release/fs-ext.node
make: Leaving directory '/home/ubuntu/test/node_modules/fs-ext/build'
npm WARN saveError ENOENT: no such file or directory, open '/home/ubuntu/test/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/ubuntu/test/package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.

+ fs-ext@1.2.1
added 2 packages from 9 contributors and audited 2 packages in 7.899s
found 0 vulnerabilities

An error thrown when I tried to require this module at node console.

$ node

> var fs = require('fs-ext');

Thrown:
TypeError: Cannot add property SEEK_SET, object is not extensible
    at Object.<anonymous> (/home/ubuntu/test/node_modules/fs-ext/fs-ext.js:142:20)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at require (internal/modules/cjs/helpers.js:14:16)

This is version of node:

$ node -v

v11.12.0

This is version of gcc:

$ gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.11' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 

This is version of system(ubuntu):

$ uname -a

Linux ubuntu 4.12.0-041200rc2-generic #201705212331 SMP Mon May 22 03:32:26 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
@hilookas
Copy link
Author

well... #82 maybe have the same problem...

@davedoesdev
Copy link
Contributor

@lookas2001 this should be fixed now - would you mind checking?

@hilookas
Copy link
Author

@davedoesdev It works fine. Thank you very much! :>

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

2 participants