Node Modules Not Being Found in Electron App - node.js

I am in progress of making a simple Electron app. When I boot the app from the console on my Win10 PC (using the classic npm i && npm start), it boots the modules and works like a charm. When I bring it to an iMac running High Sierra for testing for its deployment, it crashes when I try to use the app with the error of Cannot find module {insert module here}. I've tried clearing the cache (recommended here), but it has been to no avail. I have my package.json, index.js, and downloader.js all linked below for ease.
Edit: Sorry for not linking before! The repo is here (it's pretty easy to find the package.json and index.js, the downloader.js is in the js/)
I'm open to any and all help! Thanks in advance for, like I said, any and all help!

Related

React start up problem with new react app windows [solved]

Hello i am not really sure how to explain my problem or how to ask for help.
But am going to try it anyway lately when i create a react app it installs like normal.
But from the moment i use npm start i get this error (npm start error terminal).
Which says it has nothing wrong with node js/npm so i suspected it was something about the react app dependency that was wrong. When i downgrade to a older version of react scripts it works but the newest version 16.13.1 doesn't work even tho i use this version of react on my windows laptop. In case it helps to solve my issue here is the error log that npm generates (error log npm) i hope this helps to solve my issue
I have found the solution for my problem by setting the path value for system32.
You can do this by the following steps
Goto > Control Panel\System and Security\System\Advance system setting\Enviroment variable and set system variables path C:\Windows\System32\ variable and restart your System.
After i have done these steps it seems to work

NodeJS Windows 10 geolocation module throws error in electron when the app starts

I was using module "#nodert-win10-rs4/windows.devices.geolocation" in an electronjs app which was working fine. Later I installed a node module and rebuilt all the modules. Now it stopped working and throwing error. The previous version of that module ( "#nodert-win10-rs4/windows.devices.geolocation") was 1.0.0, Thus I reinstalled it, new version of the module is "0.3.2" but still error. Even i tried this in fresh new electron quick start app and I see the same error. I'm adding here the screenshot of the package.json and the error. (FYI - The module is installed and rebuilt without any error although it has some warning, I've added a screenshot of the installation/built too). Really appreciate any help/suggestions.
I saw other posts with similar errors but I already took the actions mentioned there.
Thanks
Musa
N.B - Cross posted here
I ran into the same issue and here is how I resolved it.
Copy the windows.devices.geolocation into your electron app folder and update the dependencies to point to the location of the folder. You need to this line added to your package.json of your Electron App
"windows.devices.geolocation": "file:windows.devices.geolocation"
Navigate to the newly copied folder and build your NodeRT "addon" to match your Electron version. See this post here NodeRT with Electron
node-gyp rebuild --target=4.0.1 --arch=x64 --dist-url=https://atom.io/download/atom-shell
Run npm install at the the top level Electron app.

Issues running React app on Windows environement

I have a working react app that I had hosted on a linux environment, but the client has switched their hosting provider and now I have to run the app on a Windows environment. I personally am unfamiliar with Windows and having some serious issues getting my app to work now.
After loads of debugging and testing I now can get my app to run, but when I start it, it will throw some errors which will results in a broken app in the browser.
So when I run npm start it will start up the app and spit out this error:
Screenshot of the terminal error 1/2
Screenshot of the terminal error 2/2
It seems to spit out some complaints when using npm run watchJS which runs this command babel src --watch --out-dir lib.
I am completely lost at this point and have no idea where to go from here.
I can provide as much detail as anyone needs after looking at the question, I just don't know what else to add to this issue and don't want to fill up this question with irrelevant info.
Thanks in advance for any help
It is likely a bug with the version of npm you are using.
See this thread:
https://github.com/npm/npm/issues/18380
Try rolling back your version of npm to 5.3
The issue appears to be exclusive to windows with babel packages.

Error after packaging the app with electron-packager

I'm new to Electron, and I really love it so far, but I'm unable to package any of mine apps, at first I thought that it's maybe something related to my code, then I download "https://github.com/atom/electron-quick-start" run npm install and then I run "electron-packager . FooBar --platform=darwin --arch=x64 --version=0.28.2" it build the app but when I try to open it I get
so I didn't touch any code from the example, just wanted to build it and I got an error, what am I doing wrong? Thanks!
The versions of electron are moving very very fast.
And some times, they don't respect the "old" ways to do things (for example, declaring the app).
I advise you to not use the 0.28.2 version of electron but the most recent one.
It is very likely that the version of electron-prebuilt you are using to develop is much much much more recent than the 0.28.2 version. So, you are developing with something much newer, and then you are building with 0.28.2. This would cause the exact error that you are seeing, as older versions may not have had the electron module, which your code explicitly is importing. So... that is my suggestion. Change the version in your electron-packager command from 0.28.2 to something like 0.36.0. See if that works. Or better yet, use the same version as electron-prebuilt in your package.json.
This could be a combination of factors.
First, as others stated, the version of electron that you have might be newer than the one referenced in your build command. Locate the 'electron_prebuilt' folder inside your 'node_modules' folder, and examine the package.json file and make sure the version # is the same as what you are declaring in your build command.
If they are the same, then the issue might be that you have another version of electron on your computer that node is trying to use. If you installed electron via the -g option (global), check your home folder to see if there is another different version of electron. If you find one, either delete it or rename the 'electron_prebuilt' folder you find to something else. Try your build command again, and it should work now that you've eliminated the other versions of electron_prebuilt on your computer that node was referencing.
What worked for me was to move the "electron" module from "dev-dependencies" to "dependencies" in package.json. Try this and see if it works.

node.js server.js module'simple debug' error

I am fairly new at node.js, I am using the most recent node.js available .12 on windows 8.1 OS. I am tring to run a program that controls some robotics using a gesture control device, but whenever I run the node server.js I receive the following:
module.js:338
throw error
module cannot be found 'simple debug'
I ran npm install simple debug to see if the modules didn't install correctly with original node.js. There are two modules simple and debug and they are installed. I tried the faye install and express solutions and got nothing.
Does anyone have any ideas how to solve this?
Assuming you're using this module, you should consider adding the hyphen for simple-debug instead of simple debug.

Resources