Installed module not found in electron js - node.js

I want to contribute to an open source project called Joplin. But I am not able to setup the development environment.
I have followed the setup instructions as said here . Everything get installed but and when I launch the application in packages/app-desktop by running npm run start(it's build with electron.js) , the application get started but logs this error in the console, due to this error UI is not loaded:
I have checked that module #joplin/fork-htmlparser2 has correctly installed by running npm list #joplin/fork-htmlparser2 command
I do not understand why the error logs say cannot find module #joplin/fork-htmlparser2 since the npm command is saying it's installed.
My OS: Ubuntu 20.04,
Node: v16.0.0,
Npm:7.10.0,

Related

Electron: Unable to open X display - ERROR:browser_main_loop.cc(1400) - The futex facility returned an unexpected error code

I've been trying to run this code that brings up an electron GUI and takes input from the user. I I've used the following commands to run this project in VSCode powershell terminal:
npm install
npm start
I get the following error messages in the terminal afterwards:
Error Message 1
Error Message 2
Error Message 3
I've already checked that I have the most updated packages for nodejs, npm, electron, electron-packager and electron-builder. You can see the last three in my package.json file under the devDependencies.
Package.json dev dependencies and scripts
I don't really understand what the error is saying here. From the googling I've done, it seems like this happens on WSL when you're trying to launch an electron application but I'm working off of my local machine on Windows, so I wouldn't think that a GUI should throw an error.
I can run main.js by using electron.cmd main.js but this just brings up the GUI splash from electron but the code itself doesn't seem to be executing.
The answer in my case was switching to use Yarn instead of npm. Clearing the node modules folder and running yarn install and running election ./app from the main project folder.

nodejs is either not installed or its executable not present in path

Whenever running an Appium test while starting appium server am facing an error saying nodejs is either not installed or its executable not present in path
I have installed node-js in my machine also installed appium through the command npm install -g appium
You need to pass two arguments under appiumdriver like in this way AppiumDriver(url,cap);
URL:- appium point url.
Cap:- desiredCapability instance.

React: npm start - windows cannot find localhost

I am trying to follow tutorials for basic react-build-app.
ENVIRONMENT
I am using Ubuntu on Windows 10.
Node version: v13.3.0
NPM version: 6.13.1
So far I did,
npm install -g create-react-app
create-react-app calculator
cd calculator
npm start
PROBLEM
When I run npm start, I get pop up dialog from windows saying, Windows cannot find '\https://localhost:3000/\'. Make sure you typed the name correctly, and then try again.
Here is a screenshot of the error
However, in the cli, I see
Local: http://localhost:3000/
On Your Network: http://192.168.56.1:3000/
Note that the development build is not optimized.
To create a production build, use npm run build.```
But when I open my browser and go to http://localhost:3000/, I only see a blank page, and not the normal React logo.
EXPECTED OUTPUT
I should see the react logo when going to http://localhost:3000/, and not receive and error.
ATTEMPTS
Updated nodejs and npm.
Changed ports using package.json. Also tried
using .env file to change port. Same error.
Uninstalled and re-installed ubuntu 18.04 LTS and used NVM to install nodejs and npm.
WORKAROUND
I got tired of fixing error after error with linux, so I just set up npm and nodejs on windows instead. ran create-react-app on windows cli and it worked the first time. Told me something else was listening on the port i was trying to open, so prompted me to change port. I said yes. Now I get the landing page I was looking for.
I am very new at this and have been trying to figure this out for a couple days now, I would appreciate any advice. Thank you.
This is a WSL specific issue with one of the dependencies of react-scripts, more specifically open version 7.0.0.
To resolve, you can:
switch to react-scripts 3.2.0 in your package.json, or
run npm start from something else than WSL (e.g. Powershell), or
wait for open and react to fix the issue
Bug report in React Scripts:
https://github.com/facebook/create-react-app/issues/8081
And the corresponding bug report in open:
https://github.com/sindresorhus/open/issues/154
According to this post in the bug report in open the culprit is lines 76 & 77 of index.js in node_modules/open. If you comment them out then it works fine.
Link to comment:
https://github.com/sindresorhus/open/issues/154#issuecomment-562509596

Deployment Issue in Mean Io on Azure

I have deployed the mean app on azure ubuntu box. I have installed all the modules and dependencies of node using npm install and bower dependencies using bower install. The app in logs show that it is started on port 3000 but when I see the browser console it show this error:
aggregated.js:11 Uncaught Error: [$injector:modulerr]
http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=mean&p1=Error%3A%20…
http%3A%2F%2Fsecondreveiw.cloudapp.net%2Fmodules%2Faggregated.js%3A26%3A19)
I have aggregated true in my development.js config file.
By the way the app is working fine locally on my windows machine.

What location does Node.js needs to be installed

I am trying to setup a project to work with Grunt. I need to install Node.js for that to run. I have downloaded and installed Node.js in c:\programfiles.
However when I try running npm install in my project c:\Grunt-proj , I get an error 'npm' is not recognized as an internal or external command.
Can someone help me with where to install Node.js? I am trying to follow this tutorial-
http://24ways.org/2013/grunt-is-not-weird-and-hard/
Many thanks,
The location is fine. I also have installed it in Program Files. But if you need to run the command npm from a command prompt then you need to add it to the path of the system. In my case I have C:\Program Files\nodejs

Resources