Error running Electron - node.js

I succesfully had the electron GUI running for testing my app, including the electron hello world application that they have here: http://electron.atom.io/docs/tutorial/quick-start/
Now however whenever I type the command: npm start in the command line I get this error (even when just trying to set up the hello world example again):
12 error Windows_NT 6.1.7601
13 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
14 error node v4.4.4
15 error npm v2.15.1
16 error code ELIFECYCLE
17 error electron-quick-start#1.0.0 start: `electron main.js`
17 error Exit status 3221225781
18 error Failed at the electron-quick-start#1.0.0 start script 'electron main.js'.
18 error This is most likely a problem with the electron-quick-start package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error electron main.js
18 error You can get information on how to open an issue for this project with:
18 error npm bugs electron-quick-start
18 error Or if that isn't available, you can get their info via:
18 error
18 error npm owner ls electron-quick-start
18 error There is likely additional logging output above.
Also one instance of an electron app I set up previously still works when I call npm start.
I would like to be able to setup new apps, partially because my original one doesn't have the correct folder structure.
So using npm list --depth 1 I went to both the folders with both the working electron app, and the not working electron app. Both show electron-prebuilt#1.1.0 as being present. Although using npm list -g shows that electron-prebuilt is not installed globally, perhaps that would be a good idea?

Update Electron to v1.1.1 (npm install electron-prebuilt#latest --save-dev) and that should hopefully solve your issue (which is probably that you're missing the VC++2015 runtime). Installing electron-prebuilt globally isn't going to fix anything.

Related

VSCode terminal can't find NodeJs

my VSCode (Win10) terminal is having issues when running NodeJs commands, such as npm run start (reactJs) or even npm install. I'm getting an error as if NodeJs was not in the $PATH as below. However, when I open the command prompt or powershell (without admin rights) the commands run normally.
Until yesterday it was working fine. Any ideas?
16 verbose Windows_NT 10.0.19041
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
18 verbose node v12.18.4
19 verbose npm v6.14.6
20 error code ELIFECYCLE
21 error errno 1
22 error xbet-betfair#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the xbet-betfair#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Just to clarify, the files are were they are expected to be and, again, when I run them OUTSIDE VSCode everything works fine. The above is an example, but happens when a npm install requires to run a script to do an install too. For some reason, VSCode terminal can't find node.

Error with 'npm start'

I'm using Node v4.2.6 and npm v3.5.2 on Ubuntu, I clone my proyect from github and install all the modules. When I do npm start its run fine, but when I try to run it again start crashing and the only way I find to make it work again is to re-clone the project.
It's a rare and dummy question i think, can someone help me? Pardon my bad english, here is the npm-debug.log error:
17 error Linux 4.4.0-92-generic
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "lite"
19 error node v4.2.6
20 error npm v3.5.2
21 error code ELIFECYCLE
22 error firstApp-client#1.0.0 lite: lite-server
22 error Exit status 1
23 error Failed at the firstApp-client#1.0.0 lite script 'lite-server'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the firstApp-client package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error lite-server
23 error You can get information on how to open an issue for this project with:
23 error npm bugs firstApp-client
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls firstApp-client
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
I don't know why but it seems to be that the problem was an incompatibility of the versions of nodejs.
I run:
$ sudo npm cache clean -f
$ sudo npm install -g n
$ sudo n stable
$ sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/nodejs
And all was resolve. Thanks for the comments

Error during npm start files not found

I'm new to electron and I am trying to get it up and running on my machine. I am trying to follow along with a tutorial titled 'Creating Your First Desktop App With HTML, JS and Electron'.
I set up the folder where I wanted the files to be downloaded to and extracted them to it but after running npm intall (I did the npm start) an error showed up. this log came back. Please help me understand how to properly install or give file names need to make electron run.
I am using a windows 10 x64 machine.
here is the log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#3.10.5
3 info using node#v4.4.7
4 verbose stack Error: ENOENT: no such file or directory, open 'c:\Users\Desktop\WestHelper\package.json'
4 verbose stack at Error (native)
5 verbose cwd c:\Users\Desktop\WestHelper
6 error Windows_NT 10.0.10586
7 error argv "C:\Program Files\nodejs\node.exe"
"C:\Users\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "start"
8 error node v4.4.7
9 error npm v3.10.5
10 error path c:\Users\Desktop\WestHelper\package.json
11 error code ENOENT
12 error errno -4058
13 error syscall open
14 error enoent ENOENT: no such file or directory, open 'c:\Users\Desktop\WestHelper\package.json'
15 error enoent ENOENT: no such file or directory, open 'c:\Users\Desktop\WestHelper\package.json'
15 error enoent This is most likely not a problem with npm itself
15 error enoent and is related to npm not being able to find a file.
16 verbose exit [ -4058, true ]
the idea behind NPM is to install packages from package.json shipped with application, so everybody can download dependencies and packages used in project. Because of this, when you run npm install, it searches current directory for file named package.json and tries to read dependency tree from it. The message you posted says, it could not find any in directory c:\Users\Desktop\WestHelper\package.json
If I've found correct tutorial, there is a section called How it’s made where the content package.json file is present.
Hope it helped, have a wonderful day.
T

Npm install doesn't work on Windows 10

i have an issue with nodejs. I'm trying to install ember.js library through the command line. When i launch "npm install" command this log appear:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm#2.11.3
3 info using node#v0.12.7
4 verbose config Skipping project config: C:\Users\Antonio/.npmrc. (matches userconfig)
5 verbose readDependencies loading dependencies from C:\Users\Antonio\package.json
6 error install Couldn't read dependencies
7 verbose stack Error: ENOENT, open 'C:\Users\Antonio\package.json'
7 verbose stack at Error (native)
8 verbose cwd C:\Users\Antonio
9 error Windows_NT 6.3.9600
10 error argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
11 error node v0.12.7
12 error npm v2.11.3
13 error path C:\Users\Antonio\package.json
14 error code ENOPACKAGEJSON
15 error errno -4058
16 error package.json ENOENT, open 'C:\Users\Antonio\package.json'
16 error package.json This is most likely not a problem with npm itself.
16 error package.json npm can't find a package.json file in your current directory.
17 verbose exit [ -4058, true ]
I've visited NPM Troubleshooting but i can't found the solution (i tried the three options but nothing happen).
Just to say: there is yet a folder named "npm" in AppData/Roaming.
The correct way to install ember is:
npm install -g ember-cli
ember new my-app
npm install by itself only works if you have a package.json in the directory where you type it.
I had this same issue trying to install some node modules to a fresh installation of Sails. I found the solution in this link: https://github.com/npm/npm/issues/9676
Just removed node_modules from my root and then npm install again, then I was able to install other modules as well.

Grunt stopped working all of a sudden

Tried running Grunt build and Grunt watch on my project yesterday and I ran into the follow error:
Fatal Error: Unable to find local grunt.
I made sure the files weren't deleted. I tried reinstalling Node and Grunt. Files are there and reinstalling didn't work. I've included the debug file for reference. Does anyone know what the issue could be?
0 info it worked if it ends with ok
1 verbose cli [ 'E:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm#1.3.24
3 info using node#v0.10.25
4 verbose node symlink E:\Program Files\nodejs\\node.exe
5 error install Couldn't read dependencies
6 error package.json ENOENT, open 'D:\sites\alleywire\package.json'
6 error package.json This is most likely not a problem with npm itself.
6 error package.json npm can't find a package.json file in your current directory.
7 error System Windows_NT 6.1.7601
8 error command "E:\\Program Files\\nodejs\\\\node.exe" "E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
9 error cwd D:\sites\alleywire
10 error node -v v0.10.25
11 error npm -v 1.3.24
12 error path D:\sites\alleywire\package.json
13 error code ENOPACKAGEJSON
14 error errno 34
15 verbose exit [ 34, true ]
You need to install grunt locally with your project (install without -g). This is not the same as grunt-cli which is the grunt command on your command line.
Run npm install inside your project folder if you have a package.json file there.

Resources