doyensec / electronegativity

Electronegativity is a tool to identify misconfigurations and security anti-patterns in Electron applications.
Apache License 2.0
972 stars 66 forks source link

Current npm version of Electronegativity has two issues preventing it from running properly #63

Closed utkanos closed 4 years ago

utkanos commented 4 years ago

Describe the bug

Bug 1) The version of Electronegativity in npm currently has issues pulling the latest release list from Electron when the application is run.

Bug2) The fsevents dependency when installing a fresh copy of Electronegativity is now a 404, and when it automatically attemps to build that package, it results in several compile errors.

To Reproduce Steps to reproduce the behavior:

(Bug 1)

  1. Run electronegativity on a target project
  2. Observe the following error:
    at Object.unlinkSync (fs.js:1035:3)
    at AvailableSecurityFixesGlobalCheck.updateReleasesList (/usr/local/lib/node_modules/@doyensec/electronegativity/dist/finder/checks/GlobalChecks/AvailableSecurityFixesGlobalCheck.js:205:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async AvailableSecurityFixesGlobalCheck.perform (/usr/local/lib/node_modules/@doyensec/electronegativity/dist/finder/checks/GlobalChecks/AvailableSecurityFixesGlobalCheck.js:51:7)
    at async GlobalChecks.getResults (/usr/local/lib/node_modules/@doyensec/electronegativity/dist/finder/globalchecks.js:96:20)
    at async run (/usr/local/lib/node_modules/@doyensec/electronegativity/dist/runner.js:199:12)
(node:37312) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:37312) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

(Bug 2)

  1. Install a fresh copy of electronegativity
  2. Observe the following 404 on dependency:
$> npm install @doyensec/electronegativity -g
/usr/local/bin/electronegativity -> /usr/local/lib/node_modules/@doyensec/electronegativity/dist/index.js

> fsevents@1.2.7 install /usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents
> node install

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.7/fse-v1.2.7-node-v72-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.7 and node@12.12.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
[snip several compile errors]

Expected behavior The application should pull the release list properly. Additionally, when installing from npm, the dependency should be available

Stacktraces See bug descriptions

Platform (please complete the following information):

Additional context Thank you, this is a great tool! I confirmed the master branch works perfectly when I pull to my system locally and build/run it. I believe the problem is in the version that's being pulled from npm.

phosphore commented 4 years ago

Hey @utkanos,

Thank you for the heads-up! We just released v1.5.0 here and on NPM, fixing and updating several outdated dependencies. Let us know if you are still experiencing problems after the update.

boutetnico commented 4 years ago

@phosphore I'm also affected by this issue. Unfortunately 1.5.0 does not solve it.

MacOS 10.14.6 node v14.0.0 npm v6.14.4

Here is the output from npm install:

npm install @doyensec/electronegativity -g
/usr/local/bin/electronegativity -> /usr/local/lib/node_modules/@doyensec/electronegativity/dist/index.js

> fsevents@1.2.7 install /usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents
> node install

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.7/fse-v1.2.7-node-v83-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.7 and node@14.0.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:222:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:22:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
X(Boolean)
^~~~~~~~~~
../../nan/nan_converters_43_inl.h:18:23: note: expanded from macro 'X'
      val->To ## TYPE(isolate->GetCurrentContext())                            \
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:2845:37: note: passing argument to parameter 'isolate' here
  Local<Boolean> ToBoolean(Isolate* isolate) const;
                                    ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:222:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:40:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
X(bool, Boolean)
^~~~~~~~~~~~~~~~
../../nan/nan_converters_43_inl.h:37:29: note: expanded from macro 'X'
  return val->NAME ## Value(isolate->GetCurrentContext());                     \
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:2855:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:223:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:356:37: error: too few arguments to function call, expected 2, have 1
  return v8::StringObject::New(value).As<v8::StringObject>();
         ~~~~~~~~~~~~~~~~~~~~~      ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:5784:3: note: 'New' declared here
  static Local<Value> New(Isolate* isolate, Local<String> value);
  ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:223:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:356:58: error: expected '(' for function-style cast or type construction
  return v8::StringObject::New(value).As<v8::StringObject>();
                                         ~~~~~~~~~~~~~~~~^
../../nan/nan_implementation_12_inl.h:356:60: error: expected expression
  return v8::StringObject::New(value).As<v8::StringObject>();
                                                           ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2722:
../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(persistent().IsNearDeath());
           ~~~~~~~~~~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2722:
../../nan/nan_object_wrap.h:127:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(wrap->handle_.IsNearDeath());
           ~~~~~~~~~~~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2818:
../../nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
      data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
                                          ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:5202:3: note: 'GetContents' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
  ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
../fsevents.cc:43:32: error: no template named 'Handle' in namespace 'v8'
    static void Initialize(v8::Handle<v8::Object> exports);
                           ~~~~^
In file included from ../fsevents.cc:73:
../src/constants.cc:89:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagNone").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagNone));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:73:
../src/constants.cc:90:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagMustScanSubDirs").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagMustScanSubDirs));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:73:
../src/constants.cc:91:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagUserDropped").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagUserDropped));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:73:
../src/constants.cc:92:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagKernelDropped").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagKernelDropped));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:73:
../src/constants.cc:93:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagEventIdsWrapped").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagEventIdsWrapped));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:73:
../src/constants.cc:94:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagHistoryDone").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagHistoryDone));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:73:
../src/constants.cc:95:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagRootChanged").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagRootChanged));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:73:
../src/constants.cc:96:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagMount").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagMount));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:73:
../src/constants.cc:97:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagUnmount").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagUnmount));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:73:
../src/constants.cc:98:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagItemCreated").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemCreated));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../fsevents.cc:73:
../src/constants.cc:99:11: error: no matching member function for call to 'Set'
  object->Set(Nan::New<v8::String>("kFSEventStreamEventFlagItemRemoved").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemRemoved));
  ~~~~~~~~^~~
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/nicolas/Library/Caches/node-gyp/14.0.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/fse/fsevents.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:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/Cellar/node/14.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64" "--napi_version=6" "--node_abi_napi=napi"
gyp ERR! cwd /usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents
gyp ERR! node -v v14.0.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/14.0.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64 --napi_version=6 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1051:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Darwin 18.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/14.0.0/bin/node" "/usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents
node-pre-gyp ERR! node -v v14.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/14.0.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/@doyensec/electronegativity/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64 --napi_version=6 --node_abi_napi=napi' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/@doyensec/electronegativity/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ @doyensec/electronegativity@1.5.0
updated 1 package in 6.43s
phosphore commented 4 years ago

Hey, as it turns out I had to completely remove fsevents from the list of our dependencies. 48dcc95898c34a05fd1d51b6064f361ebfebc2f1 should fix this behavior, but let me know if it works for you as a fix before pushing it as a patch.

Before the test, on the project dir perform:

  1. git pull
  2. rm -Rf node_modules/
  3. npm install
  4. npm run test
boutetnico commented 4 years ago

Hi @phosphore, npm run test worked for me 939 passing (5s). Thank you.

phosphore commented 4 years ago

I pushed v1.5.1 on Github and NPM. @utkanos let me know if it's fixed for you too.

Thanks again for reporting this!

boutetnico commented 4 years ago

@phosphore I was able to install electronegativity @ 1.5.1 on my machine. However when running it against my Electron app I'm facing a similar issue reported by @utkanos as "Bug 1". I tried to uninstall & reinstall electronegativity but it did not help.

Here is the output:

electronegativity -i src -v

▄▄▄ ▄▄▌ ▄▄▄ .▄▄·▄▄▄▄▄▄▄
▀▄.▀██• ▀▄.▀▐█ ▌•██ ▀▄ █▪
▐▀▀▪██▪ ▐▀▀▪██ ▄▄▐█.▐▀▀▄ ▄█▀▄
▐█▄▄▐█▌▐▐█▄▄▐███▌▐█▌▐█•█▐█▌.▐▌
 ▀▀▀.▀▀▀ ▀▀▀·▀▀▀ ▀▀▀.▀  ▀▀█▄▀▪
 ▐ ▄▄▄▄ .▄▄ • ▄▄▄▄▄▄▄▪  ▌ ▐▪▄▄▄▄▄▄· ▄▌
•█▌▐▀▄.▀▐█ ▀ ▐█ ▀•██ ██▪█·██•██ ▐█▪██▌
▐█▐▐▐▀▀▪▄█ ▀█▄█▀▀█▐█.▐█▐█▐█▐█▐█.▐█▌▐█▪
██▐█▐█▄▄▐█▄▪▐▐█ ▪▐▐█▌▐█▌███▐█▐█▌·▐█▀·.
▀▀ █▪▀▀▀·▀▀▀▀ ▀  ▀▀▀▀▀▀. ▀ ▀▀▀▀▀  ▀ •
     v1.5.1  https://doyensec.com/

Scan Status:
(node:97481) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
42 check(s) successfully loaded: 6 global, 36 atomic
████████████████████████████████████████ 100% | 6/6
(node:97481) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, unlink 'releases.37bf78d7bc3d55086b8b8bd61238ca3dadea4f0e.json'
    at Object.unlinkSync (fs.js:1155:3)
    at AvailableSecurityFixesGlobalCheck.updateReleasesList (/usr/local/lib/node_modules/@doyensec/electronegativity/dist/finder/checks/GlobalChecks/AvailableSecurityFixesGlobalCheck.js:205:26)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async AvailableSecurityFixesGlobalCheck.perform (/usr/local/lib/node_modules/@doyensec/electronegativity/dist/finder/checks/GlobalChecks/AvailableSecurityFixesGlobalCheck.js:51:7)
    at async GlobalChecks.getResults (/usr/local/lib/node_modules/@doyensec/electronegativity/dist/finder/globalchecks.js:119:20)
    at async run (/usr/local/lib/node_modules/@doyensec/electronegativity/dist/runner.js:199:12)
(node:97481) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:97481) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
phosphore commented 4 years ago

This could be a problem related to how we are saving the releases file, also experienced in #54. I switched to using the real temporary directory for each OS with temp-dir and catching any exception related to the unlinking of the file (f9a43299b1d2418b86c51f27f0f53b8ef4c6ce14).

boutetnico commented 4 years ago

@phosphore I have pull and built master and it's working now. Good job!

utkanos commented 4 years ago

1.5.2 works great now as installed from npm, thank you for the super fast response time and for this great tool once again.