Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'object-keys' #884

Closed
mercurytoxic opened this issue Jan 10, 2020 · 12 comments
Closed

Error: Cannot find module 'object-keys' #884

mercurytoxic opened this issue Jan 10, 2020 · 12 comments

Comments

@mercurytoxic
Copy link

mercurytoxic commented Jan 10, 2020

Platform & OS Version

Linux red 5.4.8-arch1-1 #1 SMP PREEMPT Sat, 04 Jan 2020 23:46:18 +0000 x86_64 GNU/Linux

The version of zmNinja you are reporting:

Release 1.3.86

The version and OS of ZoneMinder you are using:

1.33.16, Linux zoneminder 5.4.8-arch1-1 #1 SMP PREEMPT Sat, 04 Jan 2020 23:46:18 +0000 x86_64 GNU/Linux

Device details:

Desktop

Details

When I try to run dist/zmninjapro-1.3.86-linux-x86_64.AppImage after a successful build with npm run dist-lin I get:

[vagrant@archlinux zmNinja]$ dist/zmninjapro-1.3.86-linux-x86_64.AppImage 
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'object-keys'
    at Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
    at Function.Module._resolveFilename (/tmp/.mount_zmninjzJr6pl/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (internal/modules/cjs/loader.js:528:25)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/tmp/.mount_zmninjzJr6pl/resources/node_modules/deep-equal/index.js:1:173)
    at Object.<anonymous> (/tmp/.mount_zmninjzJr6pl/resources/node_modules/deep-equal/index.js:114:3)
    at Module._compile (internal/modules/cjs/loader.js:711:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)

Thanks!

@mercurytoxic
Copy link
Author

For me the only way to be able to build it successfully was to do the following:

npm install

for some reason some modules seem to not correctly installed or the versions are wrong so I fixed it with:

npm install "object-keys@<1.1.1" "regexp.prototype.flags@<1.2.0" "function-bind@<1.1.1" "has@<1.0.3" "is-regex@<1.0.4" "object-is@<1.0.1" "is-arguments@<1.0.4" "define-properties@<1.1.3" "es-abstract@<1.17.0" "has-symbols@<1.0.1" "is-date-object@<1.0.1"

and then build and run:

npm run dist-lin
dist/zmninjapro-1.3.86-linux-x86_64.AppImage

pliablepixels added a commit that referenced this issue Jan 10, 2020
@neillbell
Copy link
Contributor

I no longer get the missing object-keys error. Now I get the following:

A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'is-arguments'
    at Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
    at Function.Module._resolveFilename (/tmp/.mount_zmninj8ESmci/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (internal/modules/cjs/loader.js:528:25)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/tmp/.mount_zmninj8ESmci/resources/node_modules/deep-equal/index.js:2:19)
    at Object.<anonymous> (/tmp/.mount_zmninj8ESmci/resources/node_modules/deep-equal/index.js:114:3)
    at Module._compile (internal/modules/cjs/loader.js:711:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)

I tried adding is-arguments as you did object-keys, but I still get the same error. I must be missing something.

@neillbell
Copy link
Contributor

I was able to get it to work with the following changes:

diff --git a/package.json b/package.json
index 511871a..3f0fc31 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "zmninjapro",
   "description": "Home security mobile app for ZoneMinder",
-  "version": "1.3.086",
+  "version":"1.3.086",
   "displayName": "zmNinja",
   "author": "Pliable Pixels",
   "license": "custom see LICENSE.md",
@@ -67,7 +67,17 @@
   "dependencies": {
     "app-builder-lib": "^22.1.0",
     "clivas": "^0.2.0",
+    "define-properties": "^1.1.3",
+    "es-abstract": "^1.17.0",
+    "function-bind": "^1.1.1",
+    "object-is": "^1.0.2",
     "object-keys": "^1.1.1",
+    "has": "^1.0.3",
+    "has-symbols": "^1.0.1",
+    "is-arguments": "^1.0.4",
+    "is-date-object": "^1.0.2",
+    "is-regex": "^1.0.5",
+    "regexp.prototype.flags": "^1.3.0",
     "cordova-android": "8.0.0",
     "cordova-custom-config": "^5.1.0",
     "cordova-ios": "^5.0.1",
@@ -158,8 +168,17 @@
       "node_modules/menu/**/*",
       "node_modules/clivas/**/*",
       "node_modules/keypress/**/*",
-      "node_modules/object-keys/**/*"
-
+      "node_modules/define-properties/**/*",
+      "node_modules/object-is/**/*",
+      "node_modules/object-keys/**/*",
+      "node_modules/es-abstract/**/*",
+      "node_modules/function-bind/**/*",
+      "node_modules/has/**/*",
+      "node_modules/has-symbols/**/*",
+      "node_modules/is-arguments/**/*",
+      "node_modules/is-date-object/**/*",
+      "node_modules/is-regex/**/*",
+      "node_modules/regexp.prototype.flags/**/*"
     ],
     "mac": {
       "category": "productivity",
@@ -195,4 +214,4 @@
       ]
     }
   }
-}
\ No newline at end of file
+}

This was kind of a pain in the ass. Is there a more elegant way to fix it?

@pliablepixels
Copy link
Member

Are you trying to build via make-desktop or npm run? The latter is the right way.

@neillbell
Copy link
Contributor

I'm using npm run.

@pliablepixels
Copy link
Member

Ah yes, so object-keys likely has other dependencies which need to be manually copied over. I agree, it's dirty. I'll look at cleaning it up when I am back in town (end of month). More interestingly, I wonder why linux builds have this issue. I don't see it while building on my mac.

@neillbell
Copy link
Contributor

That's odd. I built it on my Hackintosh and saw the same problem. When I use my new package.json it works correctly.

@pliablepixels
Copy link
Member

I see - then maybe I need to try with a clean build.

@mercurytoxic
Copy link
Author

Can verify that @neillbell patch works on my system.

@pliablepixels
Copy link
Member

@neillbell can you do a PR please? I'll merge for now

@neillbell
Copy link
Contributor

Sure thing.

@mercurytoxic
Copy link
Author

#885 Fixed this.

Simpler1 pushed a commit to Simpler1/zmNinja that referenced this issue Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants