Giter Club home page Giter Club logo

node-fs-ext's People

Contributors

abetomo avatar adamansky avatar alessioalex avatar awick avatar bajtos avatar baudehlo avatar davedoesdev avatar ellacochran avatar ggreer avatar ikokostya avatar imyller avatar japj avatar mikesamuel avatar pnemade avatar rlidwka avatar saikirandaripelli avatar sam-github avatar timbertson avatar tshinnic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

node-fs-ext's Issues

Abandoned?

This module has been broken for Windows installs for 18 months (see #44). Is it still maintained?

Installation error with nan 1.5+

When installing fs-ext with npm, the compilation step fails with the following errors:

  CXX(target) Release/obj.target/fs-ext/fs-ext.o
In file included from ../node_modules/nan/nan.h:63:0,
                 from ../fs-ext.cc:27:
../node_modules/nan/nan_new.h: In instantiation of ‘typename NanIntern::Factory<T>::return_t NanNew(A0) [with T = v8::Integer; A0 = long unsigned int; typename NanIntern::Factory<T>::return_t = v8::Local<v8::Integer>]’:
../fs-ext.cc:129:112:   required from here
../node_modules/nan/nan_new.h:184:41: error: call of overloaded ‘New(long unsigned int&)’ is ambiguous
   return NanIntern::Factory<T>::New(arg0);
                                         ^
../node_modules/nan/nan_new.h:184:41: note: candidates are:
In file included from ../node_modules/nan/nan.h:63:0,
                 from ../fs-ext.cc:27:
../node_modules/nan/nan_new.h:86:26: note: static NanIntern::IntegerFactory<T>::return_t NanIntern::IntegerFactory<T>::New(int32_t) [with T = v8::Integer; NanIntern::IntegerFactory<T>::return_t = v8::Local<v8::Integer>; int32_t = int]
   static inline return_t New(int32_t value);
                          ^
../node_modules/nan/nan_new.h:87:26: note: static NanIntern::IntegerFactory<T>::return_t NanIntern::IntegerFactory<T>::New(uint32_t) [with T = v8::Integer; NanIntern::IntegerFactory<T>::return_t = v8::Local<v8::Integer>; uint32_t = unsigned int]
   static inline return_t New(uint32_t value);
                          ^
In file included from ../node_modules/nan/nan.h:63:0,
                 from ../fs-ext.cc:27:
../node_modules/nan/nan_new.h: In function ‘typename NanIntern::Factory<T>::return_t NanNew(A0) [with T = v8::Integer; A0 = long unsigned int; typename NanIntern::Factory<T>::return_t = v8::Local<v8::Integer>]’:
../node_modules/nan/nan_new.h:185:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [Release/obj.target/fs-ext/fs-ext.o] Error 1

Locking nan to 1.4.1 works around the problem: timmclean@f527f55

I'm on Ubuntu 14.04.1 LTS, using Node.js v0.10.33.

Thanks!
Tim

error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’

EDIT: The bug of "REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’" is explained here:
https://github.com/fivdi/onoff/wiki/Node.js-v0.10.29-and-native-addons-on-the-Raspberry-Pi

Bug report:
I want to install fs-ext on Raspberry Pi2 with Rasbian distro.
The npm command returns: npm ERR! not OK code 0.
I could not find any npm-debug.log file.

I have these program versions:
$ npm --version
1.4.21

$ nodejs --version
v0.10.29

$ g++ --version
g++ (Raspbian 4.9.2-10) 4.9.2

$ lsb_release -a
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 8.0 (jessie) for Raspberry Pi.

Release: 8.0 Codename: jessie

$ npm install fs-ext

[email protected] install /home/pi/node_modules/fs-ext
node-gyp configure build

make: Entering directory '/home/pi/node_modules/fs-ext/build'
CXX(target) Release/obj.target/fs-ext/fs-ext.o
In file included from ../fs-ext.cc:27:0:
../node_modules/nan/nan.h:328:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
../fs-ext.cc: In function ‘void EIO_After(uv_work_t_)’:
../fs-ext.cc:108:20: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char_, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
argv[0] = Nan::NanErrnoException(store_data->error);
^
../fs-ext.cc:108:55: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char_, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
argv[0] = Nan::NanErrnoException(store_data->error);
^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flock(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:297:45: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char_, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
if (i != 0) return Nan::ThrowError(Nan::NanErrnoException(errno));
^
../fs-ext.cc:297:68: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char_, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
if (i != 0) return Nan::ThrowError(Nan::NanErrnoException(errno));
^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Seek(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:339:56: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char_, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
if (offs_result == -1) return Nan::ThrowError(Nan::NanErrnoException(errno));
^
../fs-ext.cc:339:79: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char_, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
if (offs_result == -1) return Nan::ThrowError(Nan::NanErrnoException(errno));
^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Fcntl(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:375:51: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char_, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
if (result == -1) return Nan::ThrowError(Nan::NanErrnoException(errno));
^
../fs-ext.cc:375:74: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char_, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
if (result == -1) return Nan::ThrowError(Nan::NanErrnoException(errno));
^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE UTime(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:433:47: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char_, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
if (ret != 0) return Nan::ThrowError(Nan::NanErrnoException(errno, "utime", "", path));
^
../fs-ext.cc:433:90: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char
, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
if (ret != 0) return Nan::ThrowError(Nan::NanErrnoException(errno, "utime", "", path));
^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE StatVFS(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:469:47: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char
, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
if (ret != 0) return Nan::ThrowError(Nan::NanErrnoException(errno, "statvfs", "", path));
^
../fs-ext.cc:469:92: warning: ‘v8::Localv8::Value Nan::NanErrnoException(int, const char
, const char_, const char_)’ is deprecated (declared at ../node_modules/nan/nan.h:1184) [-Wdeprecated-declarations]
if (ret != 0) return Nan::ThrowError(Nan::NanErrnoException(errno, "statvfs", "", path));
^
fs-ext.target.mk:82: recipe for target 'Release/obj.target/fs-ext/fs-ext.o' failed
make: *
* [Release/obj.target/fs-ext/fs-ext.o] Error 1
make: Leaving directory '/home/pi/node_modules/fs-ext/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 4.1.13-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "configure" "build"
gyp ERR! cwd /home/pi/node_modules/fs-ext
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! [email protected] install: node-gyp configure build
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 fs-ext package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls fs-ext
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.1.13-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "fs-ext"
npm ERR! cwd /home/pi/irrman
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/irrman/npm-debug.log

npm ERR! not ok code 0

Fs-ext installed fine on Ubuntu 15.10 and now I want to move the code to Raspberry Pi2 that runs Rasbian/Debian distro. I have already NPM'ed various Node modules with success, like; express, wiring-pi, watch, workerjs, semaphore and death.

This seems to break for worker threads

I am running into an issue where loading fs-ext in a worker thread gives me Error: Module did not self-register as well as

Emitted 'error' event on Worker instance at:
    at Worker.[kOnErrorMessage] (internal/worker.js:232:10)
    at Worker.[kOnMessage] (internal/worker.js:242:37)
    at MessagePort.<anonymous> (internal/worker.js:163:57)
    at MessagePort.emit (events.js:315:20)
    at MessagePort.onmessage (internal/worker/io.js:78:8)
    at MessagePort.exports.emitMessage (internal/per_context/messageport.js:11:10)

Is it true that this package is not compatible with worker threads? If yes, how can this be fixed?

Does this module still work?

Even though I've installed the module successfully and put a lock on a file I could still write to that file from other processes.

Don't override fs module

Problem

Now node-fs-ext overrides fs module, i.e. adds new constants to it. Because Node.js modules are cached, other modules got implicitly redefined fs module.

Also, since Node.js 11 constants are not extensible anymore #76 and deprecated since Node.js 6. So, there is no way to get them in new versions of Node.js (only import binding file directly).

Proposal

Instead node-fs-ext can export own constants and doesn't touch core fs module:

const {fcntl, constants} = require('fs-ext');

fs.fcntl(fd, constants.F_SETLK, constants.F_WRLCK, (err) => { ... }); 

Related Issues

#81

record-level locking...

It would be nice if you can do a record level lock for read/write...

fs.flock(fd, 'sh', function(err){
  fs.flockRead(bytesToRead, function(err, buffer){
    //buffer should be the bytes read after an exclusive lock of that record
    // offset at the current position, for the length of the bytes requested to read.
  });
  fs.flockWrite(buffer, function(err){})
});

error installing fs-ext

npm install fs-ext -g
npm WARN [email protected] package.json: bugs['web'] should probably be bugs['url']

[email protected] install /home/jigar/local/node/lib/node_modules/fs-ext
node-waf configure build

Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : ok /home/jigar/local/node/lib/node_modules
Checking for node prefix : ok /home/jigar/local/node
'configure' finished successfully (0.260s)
Waf: Entering directory /home/jigar/local/node/lib/node_modules/fs-ext/build' [1/2] cxx: fs-ext.cc -> build/default/fs-ext_1.o ../fs-ext.cc: In function ‘v8::Handle<v8::Value> Flock(const v8::Arguments&)’: ../fs-ext.cc:259:61: error: invalid conversion from ‘void (*)(eio_req*)’ to ‘int (*)(eio_req*)’ ../fs-ext.cc:259:61: error: initializing argument 1 of ‘eio_req* eio_custom(int (*)(eio_req*), int, int (*)(eio_req*), void*)’ ../fs-ext.cc: In function ‘v8::Handle<v8::Value> Seek(const v8::Arguments&)’: ../fs-ext.cc:325:57: error: invalid conversion from ‘void (*)(eio_req*)’ to ‘int (*)(eio_req*)’ ../fs-ext.cc:325:57: error: initializing argument 1 of ‘eio_req* eio_custom(int (*)(eio_req*), int, int (*)(eio_req*), void*)’ ../fs-ext.cc: In function ‘v8::Handle<v8::Value> UTime(const v8::Arguments&)’: ../fs-ext.cc:382:59: error: invalid conversion from ‘void (*)(eio_req*)’ to ‘int (*)(eio_req*)’ ../fs-ext.cc:382:59: error: initializing argument 1 of ‘eio_req* eio_custom(int (*)(eio_req*), int, int (*)(eio_req*), void*)’ ../fs-ext.cc: In function ‘v8::Handle<v8::Value> StatVFS(const v8::Arguments&)’: ../fs-ext.cc:430:63: error: invalid conversion from ‘void (*)(eio_req*)’ to ‘int (*)(eio_req*)’ ../fs-ext.cc:430:63: error: initializing argument 1 of ‘eio_req* eio_custom(int (*)(eio_req*), int, int (*)(eio_req*), void*)’ Waf: Leaving directory/home/jigar/local/node/lib/node_modules/fs-ext/build'
Build failed: -> task failed (err #1):
{task: cxx fs-ext.cc -> fs-ext_1.o}
npm ERR! error installing [email protected] Error: [email protected] install: node-waf configure build
npm ERR! error installing [email protected] sh "-c" "node-waf configure build" failed with 1
npm ERR! error installing [email protected] at ChildProcess. (/home/jigar/local/node/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected] at ChildProcess.emit (events.js:67:17)
npm ERR! error installing [email protected] at ChildProcess.onexit (child_process.js:192:12)
npm ERR! [email protected] install: node-waf configure build
npm ERR! sh "-c" "node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the fs-ext package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls fs-ext
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.38-11-generic
npm ERR! command "node" "/home/jigar/local/node/bin/npm" "install" "fs-ext" "-g"
npm ERR! cwd /media/sf_talk_to_lookup
npm ERR! node -v v0.4.12
npm ERR! npm -v 1.0.106
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /media/sf_talk_to_lookup/npm-debug.log
npm not ok

Fcntl not working on Windows 10

I cannot use fcntl or fcntlSync. When I call that functions, this exception is throw:

TypeError: binding.fcntl is not a function
    at exports.fcntlSync (C:\Users\Jose\Documents\Git\node-test\node_modules\fs-ext\fs-ext.js:112:18)
    at Object.<anonymous> (C:\Users\Jose\Documents\Git\node-test\src\main.js:7:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

What is the problem?

My enviroment:

  • Windows 10
  • Node v14.15.3
  • NPM 6.14.9

npm install fs-ext -g FAILS

Fails installing fs-ext with compilation errors:

C:\Dani-R&D\JS\mqttd>npm install fs-ext -g

[email protected] install C:\Dani-R&D\nodejs\node_modules\fs-ext
node-gyp configure build

C:\Dani-R&D\nodejs\node_modules\fs-ext>if not defined npm_config_node_gyp (node "C:\Dani-R&D\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" configure build ) else (node "" configure build )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
fs-ext.cc
..\fs-ext.cc(108): warning C4996: 'Nan::NanErrnoException': was declared deprecated [C:\Dani-R&D\nodejs\node_modules\fs-ext\build\fs-ext.vcxproj]
C:\Dani-R&D\nodejs\node_modules\fs-ext\node_modules\nan\nan.h(866): note: see declaration of 'Nan::NanErrnoException'
..\fs-ext.cc(195): error C3861: 'fcntl': identifier not found [C:\Dani-R&D\nodejs\node_modules\fs-ext\build\fs-ext.vcxproj]
..\fs-ext.cc(297): warning C4996: 'Nan::NanErrnoException': was declared deprecated [C:\Dani-R&D\nodejs\node_modules\fs-ext\build\fs-ext.vcxproj]
C:\Dani-R&D\nodejs\node_modules\fs-ext\node_modules\nan\nan.h(866): note: see declaration of 'Nan::NanErrnoException'
..\fs-ext.cc(339): warning C4996: 'Nan::NanErrnoException': was declared deprecated [C:\Dani-R&D\nodejs\node_modules\fs-ext\build\fs-ext.vcxproj]
C:\Dani-R&D\nodejs\node_modules\fs-ext\node_modules\nan\nan.h(866): note: see declaration of 'Nan::NanErrnoException'
..\fs-ext.cc(374): error C3861: 'fcntl': identifier not found [C:\Dani-R&D\nodejs\node_modules\fs-ext\build\fs-ext.vcxproj]
..\fs-ext.cc(375): warning C4996: 'Nan::NanErrnoException': was declared deprecated [C:\Dani-R&D\nodejs\node_modules\fs-ext\build\fs-ext.vcxproj]
C:\Dani-R&D\nodejs\node_modules\fs-ext\node_modules\nan\nan.h(866): note: see declaration of 'Nan::NanErrnoException'
..\fs-ext.cc(433): warning C4996: 'Nan::NanErrnoException': was declared deprecated [C:\Dani-R&D\nodejs\node_modules\fs-ext\build\fs-ext.vcxproj]
C:\Dani-R&D\nodejs\node_modules\fs-ext\node_modules\nan\nan.h(866): note: see declaration of 'Nan::NanErrnoException'
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:100:13)
gyp ERR! stack at ChildProcess.emit (events.js:185:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\Dani-R&D\nodejs\node.exe" "C:\Dani-R&D\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Dani-R&D\nodejs\node_modules\fs-ext
gyp ERR! node -v v5.10.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Dani-R&D\nodejs\node.exe" "C:\Dani-R&D\nodejs\node_modules\npm\bin\npm-cli.js" "install" "fs-ext" "-g"
npm ERR! node v5.10.0
npm ERR! npm v3.8.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp configure build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp configure build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the fs-ext package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs fs-ext
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls fs-ext
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Dani-R&D\JS\mqttd\npm-debug.log
npm-debug.log.txt

windows 10 pro 64-bit, VS2015 Community installed, node -v 5.10.0

fs-ext doesn't install on Windows

Windows 10:

npm install fs-ext

> [email protected] install C:\tmp\asdf\node_modules\fs-ext
> node-gyp configure build


C:\tmp\asdf\node_modules\fs-ext>if not defined npm_config_node_gyp (node "C:\Users\User\AppData\Roaming\nvm\v7.5.0\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure build )  else (node "" configure build )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  fs-ext.cc
  win_delay_load_hook.cc
..\fs-ext.cc(195): error C3861: 'fcntl': identifier not found [C:\tmp\asdf\node_modules\fs-ext\build\fs-ext.vcxproj]
..\fs-ext.cc(374): error C3861: 'fcntl': identifier not found [C:\tmp\asdf\node_modules\fs-ext\build\fs-ext.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\User\AppData\Roaming\nvm\v7.5.0\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 Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\Roaming\\nvm\\v7.5.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\tmp\asdf\node_modules\fs-ext
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\tmp\asdf\package.json'
npm WARN asdf No description
npm WARN asdf No repository field.
npm WARN asdf No README data
npm WARN asdf No license field.
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "fs-ext"
npm ERR! node v7.5.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! [email protected] install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp configure build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the fs-ext package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs fs-ext
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls fs-ext
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2017-05-26T12_47_10_380Z-debug.log

OSX build issues

Originally posted this issue to another library that uses fs-ext as a dependency but thought it would make sense to post it here since most of the errors seem centered around fs-ext

they are using fs-ext v0.5.0


I'm also getting installation errors:

Node v5.5.0
npm v3.3.12
OSX 10.11.2

+> npm install -g ttembed-js
/Users/me/.npm-packages/bin/ttembed-js -> /Users/me/.npm-packages/lib/node_modules/ttembed-js/bin/ttembed-js

> [email protected] install /Users/me/.npm-packages/lib/node_modules/ttembed-js/node_modules/fs-ext
> node-gyp configure build

  CXX(target) Release/obj.target/fs-ext/fs-ext.o
../fs-ext.cc:91:23: error: unknown type name 'uv_work_t'
static void EIO_After(uv_work_t *req) {
                      ^
../fs-ext.cc:92:15: error: calling a protected constructor of class 'v8::HandleScope'
  HandleScope scope;
              ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:889:13: note: declared protected here
  V8_INLINE HandleScope() {}
            ^
../fs-ext.cc:106:15: warning: 'ErrnoException' is deprecated: Use ErrnoException(isolate, ...) [-Wdeprecated-declarations]
    argv[0] = ErrnoException(store_data->error);
              ^
/Users/me/.node-gyp/5.5.0/include/node/node.h:100:45: note: 'ErrnoException' has been explicitly marked deprecated here
                inline v8::Local<v8::Value> ErrnoException(
                                            ^
../fs-ext.cc:109:33: error: no matching function for call to 'Null'
    argv[0] = Local<Value>::New(Null());
                                ^~~~
/Users/me/.node-gyp/5.5.0/include/node/v8.h:8120:18: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
Local<Primitive> Null(Isolate* isolate) {
                 ^
../fs-ext.cc:120:49: error: too few arguments to function call, expected 2, have 1
        argv[1] = Number::New(store_data->offset);
                  ~~~~~~~~~~~                   ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2483:3: note: 'New' declared here
  static Local<Number> New(Isolate* isolate, double value);
  ^
../fs-ext.cc:125:38: error: too few arguments to function call, single argument 'isolate' was not specified
        statvfs_result = Object::New();
                         ~~~~~~~~~~~ ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2930:3: note: 'New' declared here
  static Local<Object> New(Isolate* isolate);
  ^
../fs-ext.cc:127:93: error: too few arguments to function call, expected 2, have 1
        statvfs_result->Set(f_namemax_symbol, Integer::New(store_data->statvfs_buf.f_namemax));
                                              ~~~~~~~~~~~~                                  ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2496:3: note: 'New' declared here
  static Local<Integer> New(Isolate* isolate, int32_t value);
  ^
../fs-ext.cc:128:89: error: too few arguments to function call, expected 2, have 1
        statvfs_result->Set(f_bsize_symbol, Integer::New(store_data->statvfs_buf.f_bsize));
                                            ~~~~~~~~~~~~                                ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2496:3: note: 'New' declared here
  static Local<Integer> New(Isolate* isolate, int32_t value);
  ^
../fs-ext.cc:129:91: error: too few arguments to function call, expected 2, have 1
        statvfs_result->Set(f_frsize_symbol, Integer::New(store_data->statvfs_buf.f_frsize));
                                             ~~~~~~~~~~~~                                 ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2496:3: note: 'New' declared here
  static Local<Integer> New(Isolate* isolate, int32_t value);
  ^
../fs-ext.cc:130:90: error: too few arguments to function call, expected 2, have 1
        statvfs_result->Set(f_blocks_symbol, Number::New(store_data->statvfs_buf.f_blocks));
                                             ~~~~~~~~~~~                                 ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2483:3: note: 'New' declared here
  static Local<Number> New(Isolate* isolate, double value);
  ^
../fs-ext.cc:131:90: error: too few arguments to function call, expected 2, have 1
        statvfs_result->Set(f_bavail_symbol, Number::New(store_data->statvfs_buf.f_bavail));
                                             ~~~~~~~~~~~                                 ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2483:3: note: 'New' declared here
  static Local<Number> New(Isolate* isolate, double value);
  ^
../fs-ext.cc:132:88: error: too few arguments to function call, expected 2, have 1
        statvfs_result->Set(f_bfree_symbol, Number::New(store_data->statvfs_buf.f_bfree));
                                            ~~~~~~~~~~~                                ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2483:3: note: 'New' declared here
  static Local<Number> New(Isolate* isolate, double value);
  ^
../fs-ext.cc:133:88: error: too few arguments to function call, expected 2, have 1
        statvfs_result->Set(f_files_symbol, Number::New(store_data->statvfs_buf.f_files));
                                            ~~~~~~~~~~~                                ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2483:3: note: 'New' declared here
  static Local<Number> New(Isolate* isolate, double value);
  ^
../fs-ext.cc:134:90: error: too few arguments to function call, expected 2, have 1
        statvfs_result->Set(f_favail_symbol, Number::New(store_data->statvfs_buf.f_favail));
                                             ~~~~~~~~~~~                                 ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2483:3: note: 'New' declared here
  static Local<Number> New(Isolate* isolate, double value);
  ^
../fs-ext.cc:135:88: error: too few arguments to function call, expected 2, have 1
        statvfs_result->Set(f_ffree_symbol, Number::New(store_data->statvfs_buf.f_ffree));
                                            ~~~~~~~~~~~                                ^
/Users/me/.node-gyp/5.5.0/include/node/v8.h:2483:3: note: 'New' declared here
  static Local<Number> New(Isolate* isolate, double value);
  ^
../fs-ext.cc:147:22: error: member reference type 'Persistent<v8::Function>' is not a pointer; did you mean to use '.'?
  (*(store_data->cb))->Call(v8::Context::GetCurrent()->Global(), argc, argv);
  ~~~~~~~~~~~~~~~~~~~^~
                     .
../fs-ext.cc:147:24: error: no member named 'Call' in 'v8::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >'
  (*(store_data->cb))->Call(v8::Context::GetCurrent()->Global(), argc, argv);
  ~~~~~~~~~~~~~~~~~~~  ^
../fs-ext.cc:147:42: error: no member named 'GetCurrent' in 'v8::Context'
  (*(store_data->cb))->Call(v8::Context::GetCurrent()->Global(), argc, argv);
                            ~~~~~~~~~~~~~^
../fs-ext.cc:150:5: warning: 'FatalException' is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
    FatalException(try_catch);
    ^
/Users/me/.node-gyp/5.5.0/include/node/node.h:283:29: note: 'FatalException' has been explicitly marked deprecated here
                inline void FatalException(const v8::TryCatch& try_catch) {
                            ^
../fs-ext.cc:154:3: error: use of undeclared identifier 'cb_destroy'
  cb_destroy(store_data->cb);
  ^
../fs-ext.cc:159:25: error: unknown type name 'uv_work_t'
static void EIO_StatVFS(uv_work_t *req) {
                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
make: *** [Release/obj.target/fs-ext/fs-ext.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:270:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/me/.npm-packages/lib/node_modules/ttembed-js/node_modules/fs-ext
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp configure build`
npm WARN install:[email protected] Exit status 1
/Users/me/.npm-packages/lib
└── (empty)

npm ERR! code 1

EBADF, Bad file descriptor

when I tried to lock a file I am getting the error "EBADF, Bad file descriptor". The same file descriptor(fd) is working with other file operations. Please let me know if someone has a solution for this. Thank you

Note: I am working on an electron project with node version 8.9.0 on a windows 10 machine

Error installing fs-ext

When I try to install fs-ext I get the following output:

C:\git\NAuth\Source [master +2 ~3 -0 !]> npm install fs-ext
npm WARN package.json [email protected] No README data
\
> [email protected] install C:\git\NAuth\Source\node_modules\fs-ext
> node-gyp configure build


C:\git\NAuth\Source\node_modules\fs-ext>node "C:\Program Files (x86)\nodejs\node
_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" conf
igure build
gyp ERR! build error
gyp ERR! stack Error: ENOENT, open 'C:\Users\nathan.harvey\.node-gyp\0.10.33\x64
\node.lib'
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\nod
e_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\git\NAuth\Source\node_modules\fs-ext
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! [email protected] install: `node-gyp configure build`
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 fs-ext package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls fs-ext
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "fs-ext"
npm ERR! cwd C:\git\NAuth\Source
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
C:\git\NAuth\Source [master +2 ~3 -0 !]>

I think the issue is with the double \\ trying to get to node-gyp.js (C:\Program Files (x86)\nodejs\node _modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js)

Compiled against a different Node.js version using NODE_MODULE_VERSION xx

I'm trying to use the module as part of a vscode extension, but I'm getting the following error:

Activating extension 'xxx' failed: The module '\?\c:\xxx\node_modules\fs-ext\build\Release\fs-ext.node' was compiled against a different Node.js version using NODE_MODULE_VERSION xx. This version of Node.js requires NODE_MODULE_VERSION 89. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install)

image

How can I make it work? I tried installing different versions of node, but there's no version I found for which NODE_MODULE_VERSION is 89, it's not in the table here.

Note that I'm already using at least one module with native code: https://github.com/simonbuchan/native-reg, and didn't have issues with it at all.

Get the file owner in a platform-independent way

fs.stat returns the owner IDs on POSIX platforms only. The stat.uid and stat.gid members are always zero on Windows and there are no stat members exposing the user and group SIDs there.

Would you accept implementation of a method retrieving the file owner information in the fs-ext module? (I'd probably add the both user and group information, sync and async methods and fs.chown wrappers for the sake of completeness.)

I suggest adding a dedicated function, extending the fs.stat or wrapping the fs.stat:

fs.getownership
{ uid, gid /* POSIX */, usid, gsid /* Windows */ }

fs.stat
{ /* all from fs.stat */, usid, gsid /* Windows */ }

fs.stat2
{ /* all from fs.stat, uid and gid as SIDs on Windows */ }

Node.js does not provide a native way to resolve a user/group ID to the name or other information, which is usually wanted. The rest of the scenario - resolving the user and group IDs to the information - would be probably delegated to platform-specific modules.

There is a function getpwnam available on POSIX systems and exposed by the node-posix module:

fs.stat -> stat.uid -> posix.getpwnam
// { name, passwd, uid, gecos (fullname+), shell, dir }
fs.stat -> stat.gid -> posix.getgrnam
// { name, passwd, gid, members }

The file ownership is not enquired by the fstat on Windows, but using authorization and network APIs:

CreateFile -> filehandle -> GetSecurityInfo -> usersid ->
  LookupAccountSid -> username -> NetUserGetInfo
// { name, passwd, usid, fullname, dir }
CreateFile -> filehandle -> GetSecurityInfo -> groupsid ->
  LookupAccountSid -> groupname -> NetGroupGetUsers
// { name, gsid, members }

Compatible with nodejs 11?

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

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

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

Cannot install, compile error

I can't install fs-ext due to the compile error below. I have Windows 7, VS2013, Node 0.10.36 and NPM 2.6.0.

c:\Source\node-splogger\spirit-logger-file\node_modules\fs-ext>node "c:\Users\rogiers\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure build
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  fs-ext.cc
..\fs-ext.cc(195): error C3861: 'fcntl': identifier not found [c:\Source\node-splogger\spirit-logger-file\node_modules\fs-ext\build\fs-ext.vcxproj]
..\fs-ext.cc(379): error C3861: 'fcntl': identifier not found [c:\Source\node-splogger\spirit-logger-file\node_modules\fs-ext\build\fs-ext.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (c:\Users\rogiers\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Users\\rogiers\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd c:\Source\node-splogger\spirit-logger-file\node_modules\fs-ext
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Users\\rogiers\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "fs-ext"
npm ERR! node v0.10.36
npm ERR! npm  v2.6.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp configure build`
npm ERR! Exit status 1

Segmentation Fault in exnb mode

Open first node console and type:

> var fsExt = require("fs-ext")
undefined
> fd = fsExt.openSync("imageTest.png", "w")
10
> fsExt.flock(fd, "exnb")
undefined

Open second node console:

> var fsExt = require("fs-ext")
undefined
> fd = fsExt.openSync("imageTest.png", "w")
12
> fsExt.flock(fd, "exnb")
Segmentation fault (memory dump)
$ 

linux Ubuntu 16.04
node 0.10.48
fs-ext 0.5.0

Module not working on Windows

The HEAD version does not work on Windows 8.1 x64.

$ node tests\test-fs-flock.js
FAILURE: LOCK_EX is not defined correctly
  LOCK_EX    undefined    "undefined"
FAILURE: LOCK_NB is not defined correctly
  LOCK_NB    undefined    "undefined"
FAILURE: LOCK_SH is not defined correctly
  LOCK_SH    undefined    "undefined"
FAILURE: LOCK_UN is not defined correctly
  LOCK_UN    undefined    "undefined"
FAILURE: expect_errno: flockSync(): expected error EBADF, got another error
   ARGS:  { '0': 'flockSync',
  '1': -9,
  '2': [TypeError: Bad argument],
  '3': 'EBADF' }
FAILURE: expect_errno: flockSync(): expected error EBADF, got another error
   ARGS:  { '0': 'flockSync',
  '1': 98765,
  '2': [TypeError: Bad argument],
  '3': 'EBADF' }
FAILURE: expect_ok: flockSync(): returned error
   ARGS:  { '0': 'flockSync', '1': 3, '2': [TypeError: Bad argument] }
FAILURE: expect_ok: flockSync(): returned error
   ARGS:  { '0': 'flockSync', '1': 3, '2': [TypeError: Bad argument] }
FAILURE: expect_ok: flockSync(): returned error
   ARGS:  { '0': 'flockSync', '1': 3, '2': [TypeError: Bad argument] }
FAILURE: expect_ok: flockSync(): returned error
   ARGS:  { '0': 'flockSync', '1': 3, '2': [TypeError: Bad argument] }
FAILURE: expect_ok: flockSync(): returned error
   ARGS:  { '0': 'flockSync', '1': 3, '2': [TypeError: Bad argument] }

When used in Sinopia, it crashes the whole process. Release build of node v0.10.26 crashes with StackOverflow.

The debug build of node v0.10.26 reports

Unhandled exception at 0x6D5633D1 (fs-ext.node) in node.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.

Stack trace:
    fs-ext.node!_invalid_parameter_noinfo() Line 96 C++
    fs-ext.node!_get_osfhandle(int fh) Line 306 C
    fs-ext.node!_win32_flock(int fd, int oper) Line 196 C++
>   fs-ext.node!EIO_Flock(uv_work_s * req) Line 247 C++

Install fails on OpenBSD

I tried running node-gyp rebuild with the latest version of GCC, but a bunch of warnings get thrown before finally erroring out. The same happens with Clang.

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | openbsd | x64
gyp info spawn /usr/local/bin/python2
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/morfent/Documents/perl6/nqp/src/vm/js/nqp-runtime/node_modules/fs-ext/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/morfent/.node-gyp/10.15.0/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/morfent/.node-gyp/10.15.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/morfent/.node-gyp/10.15.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/morfent/Documents/perl6/nqp/src/vm/js/nqp-runtime/node_modules/fs-ext',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn gmake
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
gmake: Entering directory '/home/morfent/Documents/perl6/nqp/src/vm/js/nqp-runtime/node_modules/fs-ext/build'
  CXX(target) Release/obj.target/fs-ext/fs-ext.o
In file included from ../../nan/nan.h:192:0,
                 from ../fs-ext.cc:27:
../../nan/nan_maybe_43_inl.h: In function 'Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)':
../../nan/nan_maybe_43_inl.h:112:15: error: 'class v8::Object' has no member named 'ForceSet'
   return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
               ^
In file included from ../fs-ext.cc:27:0:
../../nan/nan.h: In function 'v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)':
../../nan/nan.h:835:60: warning: 'v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/src/node.h:176): Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, func, argc, argv);
                                                            ^
../../nan/nan.h: In function 'v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)':
../../nan/nan.h:850:62: warning: 'v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/src/node.h:169): Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, symbol, argc, argv);
                                                              ^
../../nan/nan.h: In function 'v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)':
../../nan/nan.h:865:62: warning: 'v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/src/node.h:162): Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, method, argc, argv);
                                                              ^
../../nan/nan.h: In member function 'v8::Local<v8::Value> Nan::Callback::Call_(v8::Isolate*, v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const':
../../nan/nan.h:1479:5: warning: 'v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/src/node.h:176): Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
     ));
     ^
../fs-ext.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE Flock(Nan::NAN_METHOD_ARGS_TYPE)':
../fs-ext.cc:281:40: warning: 'int32_t v8::Value::Int32Value() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2478): Use maybe version [-Wdeprecated-declarations]
   flock_data->fd = info[0]->Int32Value();
                                        ^
../fs-ext.cc:282:42: warning: 'int32_t v8::Value::Int32Value() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2478): Use maybe version [-Wdeprecated-declarations]
   flock_data->oper = info[1]->Int32Value();
                                          ^
../fs-ext.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE Seek(Nan::NAN_METHOD_ARGS_TYPE)':
../fs-ext.cc:332:32: warning: 'int32_t v8::Value::Int32Value() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2478): Use maybe version [-Wdeprecated-declarations]
   int fd = info[0]->Int32Value();
                                ^
../fs-ext.cc:317:74: warning: 'double v8::Value::NumberValue() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2475): Use maybe version [-Wdeprecated-declarations]
   if (!(a)->IsUndefined() && !(a)->IsNull() && !IsInt64((a)->NumberValue())) { \
                                                                          ^
../fs-ext.cc:333:3: note: in expansion of macro 'ASSERT_OFFSET'
   ASSERT_OFFSET(info[1]);
   ^
../fs-ext.cc:320:60: warning: 'int64_t v8::Value::IntegerValue() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2476): Use maybe version [-Wdeprecated-declarations]
 #define GET_OFFSET(a) ((a)->IsNumber() ? (a)->IntegerValue() : -1)
                                                            ^
../fs-ext.cc:334:16: note: in expansion of macro 'GET_OFFSET'
   off_t offs = GET_OFFSET(info[1]);
                ^
../fs-ext.cc:335:36: warning: 'int32_t v8::Value::Int32Value() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2478): Use maybe version [-Wdeprecated-declarations]
   int whence = info[2]->Int32Value();
                                    ^
../fs-ext.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE Fcntl(Nan::NAN_METHOD_ARGS_TYPE)':
../fs-ext.cc:369:32: warning: 'int32_t v8::Value::Int32Value() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2478): Use maybe version [-Wdeprecated-declarations]
   int fd = info[0]->Int32Value();
                                ^
../fs-ext.cc:370:33: warning: 'int32_t v8::Value::Int32Value() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2478): Use maybe version [-Wdeprecated-declarations]
   int cmd = info[1]->Int32Value();
                                 ^
../fs-ext.cc:371:33: warning: 'int32_t v8::Value::Int32Value() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2478): Use maybe version [-Wdeprecated-declarations]
   int arg = info[2]->Int32Value();
                                 ^
../fs-ext.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE UTime(Nan::NAN_METHOD_ARGS_TYPE)':
../fs-ext.cc:423:45: warning: 'v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2891): Use Isolate version [-Wdeprecated-declarations]
   String::Utf8Value path(info[0]->ToString());
                                             ^
../fs-ext.cc:424:40: warning: 'int64_t v8::Value::IntegerValue() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2476): Use maybe version [-Wdeprecated-declarations]
   time_t atime = info[1]->IntegerValue();
                                        ^
../fs-ext.cc:425:40: warning: 'int64_t v8::Value::IntegerValue() const' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2476): Use maybe version [-Wdeprecated-declarations]
   time_t mtime = info[2]->IntegerValue();
                                        ^
../fs-ext.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE StatVFS(Nan::NAN_METHOD_ARGS_TYPE)':
../fs-ext.cc:462:45: warning: 'v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)' is deprecated (declared at /home/morfent/.node-gyp/10.15.0/deps/v8/include/v8.h:2891): Use Isolate version [-Wdeprecated-declarations]
   String::Utf8Value path(info[0]->ToString());
                                             ^
gmake: *** [fs-ext.target.mk:103: Release/obj.target/fs-ext/fs-ext.o] Error 1
gmake: Leaving directory '/home/morfent/Documents/perl6/nqp/src/vm/js/nqp-runtime/node_modules/fs-ext/build'
gyp ERR! build error 
gyp ERR! stack Error: `gmake` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System OpenBSD 6.4
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/morfent/Documents/perl6/nqp/src/vm/js/nqp-runtime/node_modules/fs-ext
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
  • Node version:
    v10.15.0
  • OS:
    OpenBSD bastille.kennel.qt 6.4 GENERIC.MP#683 amd64

node@11 freezing constants

https://nodejs.org/en/blog/release/v11.0.0/ says

[90e8f79f65] - (SEMVER-MAJOR) constants: freeze the constants object (Bryan English) #19813

which causes problems for

node-fs-ext/fs-ext.js

Lines 139 to 144 in 7c9824f

// put constants into constants module (don't like doing this but...)
for (key in binding) {
if (/^[A-Z_]+$/.test(key) && !constants.hasOwnProperty(key)) {
constants[key] = binding[key];
}
}

// put constants into constants module (don't like doing this but...)
for (key in binding) {
  if (/^[A-Z_]+$/.test(key) && !constants.hasOwnProperty(key)) {
    constants[key] = binding[key];
  }
}

Segmentation fault in uv_ref

Hi; just wanted to leave a note here. I'm seeing a random crash (maybe one in every five executions) of a program that's using flock via node-fs-ext:

Program terminated with signal 11, Segmentation fault.
#0  0x0820323d in uv_ref (handle=0xb9148cd4) at ../deps/uv/src/uv-common.c:420
420       uv__handle_ref(handle);
(gdb) bt
#0  0x0820323d in uv_ref (handle=0xb9148cd4) at ../deps/uv/src/uv-common.c:420
#1  0xa115404c in Flock(v8::Arguments const&) ()
   from /srv/software/medic-core/v1.2.1/x86/lib/node_modules/fs-ext/build/Release/fs-ext.node
#2  0x9f34cf49 in ?? ()
#3  0x9f34c953 in ?? ()

I'm going to see if I can figure this out; obviously any ideas would be greatly appreciated.

node_modules/fs-ext/build/Release constantly disappears in yarn

Hi.

It's actually hard to reproduce (so I have a little hope you'll fix it), but happens almost every week on my laptop.

The symptom is that node_modules/fs-ext/build/Release/ folder just disappears after some of "yarn install" commands. And the only thing which helps is running:

yarn remove fs-ext; yarn add fs-ext

This happens only with fs-ext (and never with some other binary extension like e.g. bcrypt). On both Node 9 and 12.

Linux, docker environment, yarn 1.19.2 (although older versions of yarn are prone too).

Won't compile with "No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'."

node_modules/fs-ext$ node-gyp configure build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 3.9.9 found at "/usr/local/opt/[email protected]/bin/python3.9"
(node:96353) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /usr/local/opt/[email protected]/bin/python3.9
gyp info spawn args [
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/macuser/MM/spyster-node/node_modules/fs-ext/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/macuser/Library/Caches/node-gyp/16.19.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/macuser/Library/Caches/node-gyp/16.19.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/macuser/Library/Caches/node-gyp/16.19.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/macuser/MM/spyster-node/node_modules/fs-ext',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

Traceback (most recent call last):
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1500, in XcodeVersion
    version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines()
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1563, in GetStdoutQuiet
    raise GypError("Error %d running %s" % (job.returncode, cmdlist[0]))
gyp.common.GypError: Error 1 running xcodebuild

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py", line 51, in <module>
    sys.exit(gyp.script_main())
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 670, in script_main
    return main(sys.argv[1:])
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 662, in main
    return gyp_main(args)
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 647, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2451, in GenerateOutput
    writer.Write(
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 831, in Write
    self.WriteSources(
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1302, in WriteSources
    cflags = self.xcode_settings.GetCflags(
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 661, in GetCflags
    archs = self.GetActiveArchs(self.configname)
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 515, in GetActiveArchs
    xcode_archs_default = GetXcodeArchsDefault()
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 122, in GetXcodeArchsDefault
    xcode_version, _ = XcodeVersion()
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1511, in XcodeVersion
    version = CLTVersion()  # macOS Catalina returns 11.0.0.0.1.1567737322
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1549, in CLTVersion
    return re.search(regex, output).groupdict()["version"]
AttributeError: 'NoneType' object has no attribute 'groupdict'
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/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Darwin 22.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "configure" "build"
gyp ERR! cwd /Users/macuser/MM/spyster-node/node_modules/fs-ext
gyp ERR! node -v v16.19.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok 

Doesn't work on node 0.11

I don't know what they changed, but it doesn't compile anymore:

$ ~/node-crypt3/node-v0.11.13-linux-x64/bin/node `which npm` install fs-ext 
npm http GET https://registry.npmjs.org/fs-ext
npm http 200 https://registry.npmjs.org/fs-ext

> [email protected] install /tmp/node_modules/fs-ext
> node-gyp configure build

make: Entering directory `/tmp/node_modules/fs-ext/build'
  CXX(target) Release/obj.target/fs-ext/fs-ext.o
../fs-ext.cc:91:23: error: variable or field ‘EIO_After’ declared void
 static void EIO_After(uv_work_t *req) {
                       ^
../fs-ext.cc:91:23: error: ‘uv_work_t’ was not declared in this scope
../fs-ext.cc:91:34: error: ‘req’ was not declared in this scope
 static void EIO_After(uv_work_t *req) {
                                  ^
make: *** [Release/obj.target/fs-ext/fs-ext.o] Error 1
make: Leaving directory `/tmp/node_modules/fs-ext/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2

Node 0.12 is probably going to be released soon, so it'd be nice to be ready for that.

Can't install it anymore - Is this deprecated ?

I can't install this anymore.
I am on Windows 10.

PS D:\Projects\VSCode Projects\proiect_final_link> npm install fs-ext
npm ERR! code 1
npm ERR! path D:\Projects\VSCode Projects\proiect_final_link\node_modules\fs-ext
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp configure build
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.5 found at "C:\Python39\python.exe"
npm ERR! gyp info find VS using VS2019 (16.9.31229.75) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! (node:6860) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.    
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn C:\Python39\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\Projects\\VSCode Projects\\proiect_final_link\\node_modules\\fs-ext\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\georg\\AppData\\Local\\node-gyp\\Cache\\16.1.0\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\georg\\AppData\\Local\\node-gyp\\Cache\\16.1.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\georg\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.1.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=D:\\Projects\\VSCode Projects\\proiect_final_link\\node_modules\\fs-ext',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'D:\\Projects\\VSCode Projects\\proiect_final_link\\node_modules\\fs-ext\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: C:\Users\georg\AppData\Local\node-gyp\Cache\16.1.0\common.gypi not found (cwd: D:\Projects\VSCode Projects\proiect_final_link\node_modules\fs-ext) while reading includes of binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
npm ERR! gyp ERR! cwd D:\Projects\VSCode Projects\proiect_final_link\node_modules\fs-ext
npm ERR! gyp ERR! node -v v16.1.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

add access() support

I have created sync/async versions of the UNIX access() function.
It may be a good idea to incorporate it into your module not to be available separately as it is now. Check it out here: https://github.com/lobodpav/node-unix-access

What do you think? The only thing is that my module works on UNIX-like systems only.

I couldn't install fs-ext

I couldn't install fs-ext in windows,when I get the error
gyp ERR! build error
gyp ERR! stack Error: ENOENT, open 'C:\Users\Administrator.node-gyp\0.10.26\x64
\node.lib'
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "D:\Program Files\nodejs\node_modules\npm\node_modu
les\node-gyp\bin\node-gyp.js" "configure" "build"
gyp ERR! cwd D:\Users\paopao\workspace\viewer\node_modules\fs-ext
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp configure build
npm ERR! Exit status 1
npm ERR!
And when I copy the fs-ext form centos I get the error:
Error: %1 is not a valid Win32 application
I know that npm is download The Source Code and use gyp complie .
why I complie it failed

Cannot compile in Windows

First things first, does this module work on Windows? (I figured it did, because windows-specific headers are included in fs-ext.cc)

I am unable to build it on Windows 7. The error says:
Cannot open include file: 'sys/file.h': No such file or directory

I already have all the dependencies listed in node-gyp Readme installed. Am I missing something here?

Thanks in advance.

F_WRLCK not added to constants in Node.js 11

In Node.js 11:

$ node
> const fs = require('fs-ext')
undefined
> require('constants').F_WRLCK
undefined
> process.versions.node
'11.10.0'

In Node.js 10:

$ node
> const fs = require('fs-ext')
undefined
> require('constants').F_WRLCK
3
> process.versions.node
'10.15.1'

seek doesn't work on Windows

lseek() triggers a VC++ library assertion with the message Expression: (_osfile(fh) & FOPEN) when fs-ext is compiled in debug mode. In release mode it just silently crashes.

The same thing happens when you try to call _get_osfhandle(fd), which is strange since libuv opens files on Windows with _open_osfhandle() on the handle returned by CreateFileW. The return value is the fd which is used by node, so you would think that _get_osfhandle() should work but it doesn't for some reason. I've tried asking in #libuv about it but I guess there aren't many Windows dev gurus in there.

Anyway FWIW I used VC2010 Express with Win7 SDK to compile fs-ext.

flock not working with fs.open ?!

Hello !
I am trying this module in a simple express server, but flock doesn't seem to work with fs.open.

The following code doesn't work as it returns TypeError: Bad argument

  // open file
  const networkFile = fs.open(path.join(__dirname + '/test.txt'), "w+", (err, f) => {
    if(err) {
      console.log("Could not open file.");
    }
    console.log(f);
  });
  // lock file
  flock(networkFile, 'ex', (err) => {
    if(err) {
      return console.log("Could not lock file.");
    }
    // file is locked
    console.log("File is locked.");
  });

Chaning from fs.open to fs.openSync made flock work, so the following code works:

const networkFile = fs.openSync(path.join(__dirname + '/test.txt'), "w+");

Is this normal behavior ? Should fs.open not work with flock ? And if that's the case, can somebody explain as to why ?

Thank you.

Hangs forever on multiple simultaneous calls

Thank you for at very nice extension!
I have a critical issue I need to have solved:

The following example code, updates and returns a counter, stored in a file.
If I call the function more than a handful of times, it hangs forever, apparently in the fs.read function.
Would you please look into this?

var fs = require('fs-ext');
const counter = (callback) => {
  fs.open('counter.txt',"r+", (err,fd) => {
    if(err) throw err;
    fs.flock(fd, 'ex', (err) => {
      if(err) throw err;
      let buffer = Buffer.alloc(20);
      fs.read(fd, buffer,0, buffer.length, 0 , (err, readCount, buffer) => {
        if(err) throw err;
        var count = 1 + (parseInt(buffer.toString('utf8',0,readCount)) || 0);
        fs.write(fd,count + " ",0,(err) => {
          if (err) throw err;
          fs.close(fd, () =>{
            if(typeof callback == 'function')  callback(count);
          });
        });
      });
    });
  });
};

fs.writeFile('counter.txt',' '.repeat(20),(err) => {
  for(let i=0; i<100; i++)
    counter(console.log);
});

A appreciate the effort and would like to suggest some other useful add-ons.
My understanding of the node framework and windows is minimal. But if you are interested, I might find time to write some useful extension in C++. Would you be interested in integrating that?

Best regrads
Simon Rigèt

More than 4 exclusive flocks on the same file do not acquire more than the first lock

When calling flock to lock a single file exclusively but having distinct fd's more than 4 time only the first lock succeeds.

Test Code:

var count = 4;
var fs = require('fs');
var fsext = require('fs-ext');
var all=[];
while(all.length < count) all.push(fs.openSync('test.lock', 'w'));
console.log('FDS: ', all);
all.forEach(function(fd, idx) {
  fsext.flock(fd, 'ex', function() {
    console.log('Locked('+fd+'): '+idx);
    setTimeout(function() {
      console.log('Try-Unlock('+fd+'): '+idx);
      fsext.flock(fd, 'un', function(err) {
        console.log(err && (err.message || err) || ('Unlocked('+fd+'): '+idx));
      });
    }, 1000);
  });
});

this works if count is 4 or less, but once count hits 5 it stops working:

Output for count=4:

FDS:  [ 10, 11, 12, 13 ]
Locked(10): 0
Try-Unlock(10): 0
Unlocked(10): 0
Locked(11): 1
Try-Unlock(11): 1
Unlocked(11): 1
Locked(12): 2
Try-Unlock(12): 2
Unlocked(12): 2
Locked(13): 3
Try-Unlock(13): 3
Unlocked(13): 3

Output for count=5:

FDS:  [ 10, 11, 12, 13, 14 ]
Locked(10): 0
Try-Unlock(10): 0

after which it hangs, because there are open files, but the second lock is never acquired.

Just wanted to note this bug for now, I'll try to look into what's happening on the C++ level when I have some more time.

Node-fs-ext and Windows 10

I'm rather new to node.js, so I'm still learning how things work in this eco system. With several modules which need some compiling, when trying to install, that process complains about fs-ext. Mosca for example. I get an "Unable to install fs-ext using npm: error C3861: 'fcntl': identifier not found". I did some googling and found this topic which suggest to contact the maintainer of fs-ext and ask to fix the npm version as well, since it's fixed an the Github version. Is this correct? And if so, would you kindly fix the npm version as well? My skills don't allow for fixing it myself yet.

Compilation warnings

NanErrnoException is deprecated in favour of ErrnoException

  CXX(target) Release/obj.target/fs-ext/fs-ext.o
../fs-ext.cc: In function ‘void EIO_After(uv_work_t*)’:
../fs-ext.cc:108:20: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     argv[0] = Nan::NanErrnoException(store_data->error);
                    ^
../fs-ext.cc:108:55: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     argv[0] = Nan::NanErrnoException(store_data->error);
                                                       ^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flock(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:297:45: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     if (i != 0) return Nan::ThrowError(Nan::NanErrnoException(errno));
                                             ^
../fs-ext.cc:297:68: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     if (i != 0) return Nan::ThrowError(Nan::NanErrnoException(errno));
                                                                    ^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Seek(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:339:56: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     if (offs_result == -1) return Nan::ThrowError(Nan::NanErrnoException(errno));
                                                        ^
../fs-ext.cc:339:79: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     if (offs_result == -1) return Nan::ThrowError(Nan::NanErrnoException(errno));
                                                                               ^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Fcntl(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:375:51: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     if (result == -1) return Nan::ThrowError(Nan::NanErrnoException(errno));
                                                   ^
../fs-ext.cc:375:74: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     if (result == -1) return Nan::ThrowError(Nan::NanErrnoException(errno));
                                                                          ^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE UTime(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:433:47: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     if (ret != 0) return Nan::ThrowError(Nan::NanErrnoException(errno, "utime", "", *path));
                                               ^
../fs-ext.cc:433:90: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     if (ret != 0) return Nan::ThrowError(Nan::NanErrnoException(errno, "utime", "", *path));
                                                                                          ^
../fs-ext.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE StatVFS(Nan::NAN_METHOD_ARGS_TYPE)’:
../fs-ext.cc:469:47: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     if (ret != 0) return Nan::ThrowError(Nan::NanErrnoException(errno, "statvfs", "", *path));
                                               ^
../fs-ext.cc:469:92: warning: ‘v8::Local<v8::Value> Nan::NanErrnoException(int, const char*, const char*, const char*)’ is deprecated (declared at ../node_modules/nan/nan.h:858) [-Wdeprecated-declarations]
     if (ret != 0) return Nan::ThrowError(Nan::NanErrnoException(errno, "statvfs", "", *path));
                                                                                            ^
  SOLINK_MODULE(target) Release/obj.target/fs-ext.node
  COPY Release/fs-ext.node

npm publish

NaN v2 seems to work on my setup (El Capitan, NodeJS 4.1.2). Can you publish a new release?

Error installing fs-ext 1.1.0

When I try to install 1.1.0 I get

> [email protected] install /Users/martin/Projects/sitar-client-js/node_modules/fs-ext
> node-gyp configure build

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  CXX(target) Release/obj.target/fs-ext/fs-ext.o
../fs-ext.cc:156:40: error: too few arguments to function call, expected 4, have 3
  Nan::Call(*store_data->cb, argc, argv);
  ~~~~~~~~~                            ^
../../nan/nan_maybe_43_inl.h:326:1: note: 'Call' declared here
inline MaybeLocal<v8::Value> Call(
^
1 error generated.
make: *** [Release/obj.target/fs-ext/fs-ext.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/martin/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 17.6.0
gyp ERR! command "/Users/martin/.nvm/versions/node/v8.9.1/bin/node" "/Users/martin/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/martin/Projects/sitar-client-js/node_modules/fs-ext
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/martin/.npm/_logs/2018-06-14T21_05_56_029Z-debug.log```

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.