Using: Windows 10, NMP 6.4.1, Node v10.13.0, GIT 2.8.4
A simple app to show IMDB records:
https://ide.c9.io/learnwithcolt/webdevbootcamp folder APIS / movie_search_app
Dowloaded to run locally on Windows. It runs ok.
When I run:
electron-forge init my-new-app
√ Checking your system
It looks like you are missing some dependencies you need to get Electron running.
Make sure you have git installed and Node.js version 6.0.0+
package.json:
{
"name": "imdb",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"ejs": "^2.6.1",
"express": "^4.16.4",
"request": "^2.88.0"
},
"devDependencies": {
"electron": "^3.0.8"
}
}
The same happens with other proyects. CMD is running as Administrator.
The same happens with other proyects
Just with electron-forge or other CLI tools too? My guess is this is a path issue- electron forge can't find your Node/Git installations.
You can try npx electron-forge init my-new-app but that's a long shot.
Also, make sure you're using the correct version of Electron forge. There's a new one that's kinda broken right now.
The master branch is a rewrite of Electron Forge that will eventually be the 6.x series. If you are looking for the 5.x series (the version currently published to NPM), please view the 5.x branch.
https://github.com/electron-userland/electron-forge
Related
I have an issue while deploy my nodejs Apps to Heroku. I tried to git push directly (heroku cli) and also tried from github deploy, but both of them failed. Here log i got:
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
jq: error (at <stdin>:19): Cannot index string with string "iojs"
! Push rejected, failed to compile Node.js app.
! Push failed
I tried to check maybe dev dependents was the culprit, then try to change dev dependents package and remove all node_modules filder which "may" cause failure, but after retry, I'm still faced this issue. Also I tried to change the engine from 17.x to 16.x but still persists.
Maybe someone can give me a clue?
Below package.json i have:
{
"name": "coupling",
"version": "1.0.0",
"engines": "17.x",
"description": "",
"main": "server.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"#vercel/node": "^1.12.1",
"csv-parser": "^3.0.0",
"express": "4.17.2",
"ws": "^8.4.2"
}
}
Your engines section is invalid:
"engines": "17.x",
Its value should be an object, not a string. Try this instead:
"engines": {
"node": "17.x"
}
This week I got into electron and I have built my own simple project. I want to build it into an executable file. I have followed this video with building an electron project. The build goes as it should.
loaded configuration file=package.json ("build" field)
description is missed in the package.json appPackageFile=C:\Users\evalo\Desktop\Desktop\electron\02-nekton\package.json
writing effective config file=dist\builder-effective-config.yaml
packaging platform=win32 arch=x64 electron=16.0.5 appOutDir=dist\win-unpacked
building target=nsis file=dist\nekton Setup 1.0.1.exe archs=x64 oneClick=false perMachine=false
building block map blockMapFile=dist\nekton Setup 1.0.1.exe.blockmap
After that, I ran the installer and installed the app without any problem and launched the shortcut, which had been generated on the desktop. The main window didn't show up but in Task Manager I could see that the application is running (3 times actually after one launch, don't know why)
Content of my package.json file, if it helps:
{
"name": "nekton",
"produktName": "nekton",
"version": "1.0.1",
"description": "",
"main": "index.js",
"scripts": {
"start": "electron .",
"build": "electron-builder"
},
"build": {
"asar": true,
"appId": "nekton",
"win": {
"target": [
"nsis"
],
"icon": "nekton.ico"
},
"nsis": {
"oneClick": false,
"installerIcon": "nekton.ico",
"uninstallerIcon": "nekton.ico",
"uninstallDisplayName": "Nekton-uninstaller",
"license": "license.md",
"allowToChangeInstallationDirectory": true
}
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"electron-store": "^8.0.1",
"wallpaper": "^6.0.0"
},
"devDependencies": {
"electron": "^16.0.5",
"electron-builder": "^22.14.5"
}
}
One thing, which might affect this behaviour is that I hadn't saved electron as dev dependency before I started working on the app. I just installed it: npm i electron. When I tried to build it gave my error with a hint to move electron into dev dependencies. So I ran:
npm uninstall electron
npm i --save-dev electron
Tried to launch the app with: npm start and all worked flawlessly. So I assumed that this didn't affect the project.
**Edit:**
-----------------
I made and build an app to show static HTML files in the main window with the same build configuration. All worked flawlessly. The app launched and behaved as expected. So I have manually created a new project and copied the content of each file to the project which has been built before without error. I have encountered the same problem. The app works fine with npm start, builds, installs. After installation is complete the app 'runs' but without a window. I think there might be a run error, which would be logged into the terminal in vscode at the start and the application is halted. Is there a way I can see the terminal for my app after it has been installed?
I'm using a free tier version of aws cloud, and have some trouble with loading up a nodeJs Application. I 've tried to follow the documentation of aws but it didn't work unfortunately. I choose the Elastic BeanStalk, from the services, and create a new Application. I choose nodeJs for the preconfigured platform of course. I make a zip with my app, and I really pay attention, to not have any parent folder above package.json, and app.js . As you can see on the picture above, I have a folder "public" which contains additional folders (css,img, javascript code). When I try to upload the project, I get an error message.
"Failed to find package.json. Node.js may have issues starting. Verify package.json is valid or place code in a file named server.js or app.js." In the project view I've got a health status "degraded", and an other error code: "i-045ac359227e3a9ae" Severe
I 've tried many php projects on this server, and everything worked fine,but I can't make it work with Node. Could you help me out please?
package.json:
{
"name": "kutyapplikacio",
"version": "1.0.0",
"description": "Egy alkalmazás kutyáknak és gazdáiknak",
"main": "server.js",
"scripts": {
"test": "test",
"start": "node server.js"
},
"author": "sethdevelop",
"license": "ISC",
"dependencies": {
"body-parser": "^1.17.2",
"express": "^4.15.3",
"express-mailer": "^0.3.1",
"express-mysql": "0.0.1",
"express-validator": "^3.2.0",
"mysql": "^2.13.0",
"nodemailer": "^4.0.1",
"nodemailer-smtp-transport": "^2.7.4"
}
}
The error message you wrote is : "Failed to find package.json. Node.js may have issues starting. Verify package.json is valid or place code in a file named server.js or app.js."
From the folder I only see you have app.js file.
And in your package.json, there are server.js:
"main": "server.js",
"scripts": {
"test": "test",
"start": "node server.js"
}
Perhaps you should change server.js to app.js ?
Update
Since you mentioned they have the same name:
could it be you zipped the folder instead of zipped the files ?
Same problem has been discussed here:
https://forums.aws.amazon.com/message.jspa?messageID=477087
https://forums.aws.amazon.com/thread.jspa?threadID=130140
I have just started with nodejs and app engine. I am following the tutorial
https://cloud.google.com/nodejs/tutorials
1) I have created a project then cloned the nodejs-mvms-quickstart repository.
2) Opened Development/source code and opened the nodejs-mvms-quickstart/1-hello-world
3) and started the node server
npm start
This is working fine. Now I want to deploy my nodejs application from my local server without copying to github and cloning on the server.
For this I am using following command
gcloud app deploy
but this is showing following errors:
If this is your first deployment, this may take a while...done.
Beginning deployment of service [default]...
Building and pushing image for service [default]
WARNING: No node version specified. Please add your node version, see https://docs.npmjs.com/files/package.json#engines
Some files were skipped. Pass `--verbosity=info` to see which ones.
You may also view the gcloud log file, found at
[C:\Users\Sunil Garg\AppData\Roaming\gcloud\logs\2017.05.07\20.38.59.221000.log]
.
Started cloud build [1cd2979e-527b-4d68-b430-31471534246e].
To see logs in the Cloud Console: https://console.cloud.google.com/gcr/builds/1c
d2979e-527b-4d68-b430-31471534246e?project=help-coin
ERROR: gcloud crashed (error): [Errno 10054] An existing connection was forcibly
closed by the remote host
If you would like to report this issue,please run the following command:
gcloud feedback
To check gcloud for common problems,please run the following command:
gcloud info --run-diagnostics
Here is my package.json
{
"name": "myapp",
"version": "1.0.0",
"description": "myapp",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": ""
},
"author": "",
"license": "ISC",
"bugs": {
"url": ""
},
"homepage": "",
"dependencies": {
"body-parser": "^1.15.0",
"connect-timeout": "^1.8.0",
"express": "^4.13.4",
"generic-pool": "^2.4.2",
"multer": "^1.2.0",
"mysql": "^2.10.2",
"requestify": "^0.1.17"
}
}
What is the issue? Am I missing something?
Try adding the following 2 parameters to the package.json
Add the version of node your application is compatible with.
"engines": {
"node": "4.6.0"
}
since you're using npm start you might need this in the script parameter as well since npm start is calling command stated in start in script param, change app.js according your application, like node quickstart.js. Always make sure to specify the path if your package.json is in the root directory and the .js is in a sub directory as well.
"scripts": {
"start": "node app.js"
}
I developed a package for example: testlab, and its package.json is:
{
"devDependencies": {
"mocha": "^2.0.0"
},
"name": "#aab/testlab",
"version": "2.6.0",
"description": "example for npm",
"main": ".\\dest\\main.js",
"dependencies": {
"gulp": "^3.9.1",
"gulp-changed": "^1.3.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"test"
],
"author": "aab <aab#exmaple.com>",
"license": "ISC"
}
Say I included mocha in devDendencies, and then I created a local directory called e.g. c:\example and used
npm install #aab/testlab --only=dev
to get my package under c:\example, but when I looked at c:\example\node_modules, I did not find mocha package is installed. I also tried other command like
npm install #aab/testlab
still no luck. I used NodeJS v4.6.0 and npm 4.0.2. Although nodeJS seems a little old, could any one help me that?
I have seen this happen only when NODE_ENV is set to PRODUCTION. Something else might be setting it.