This is my package.json file:
{
"name": "pro-mern-stack",
"version": "1.0.0",
"description": "first init",
"main": "index.js",
"scripts": {
"start": "nodemon server.js server.js",
"compile": "babel src --presets react,es2015 --out-dir static",
"watch": "babel src --presets react,es2015 --out-dir static --watch",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Yusuf",
"license": "ISC",
"dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1",
"mongodb": "latest"
},
"devDependencies": {
"express": "^4.17.1",
"nodemon": "^2.0.2"
}
}
I'M TRYING TO RUN npm start TO START THE WATCHER BUT I KEEP GETTING THIS ERROR:
> nodemon server.js server.js
C:\MERN\pro-mern-stack\node_modules\nodemon\lib\monitor\run.js:356
let sig = signal.replace('SIG', '');
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\MERN\pro-mern-stack\node_modules\nodemon\lib\monitor\index.js:2:8)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! pro-mern-stack#1.0.0 start: `nodemon server.js server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pro-mern-stack#1.0.0 start script 'nodemon server.js server.js'.
npm ERR! This is most likely a problem with the pro-mern-stack package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! nodemon server.js server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pro-mern-stack
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls pro-mern-stack
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\mern\pro-mern-stack\npm-debug.log
I'm running with powershell on windows 10. I've tried installing globally, didn't work. Also have the latest version of nodemon. Please, how can i fix this? I've reinstalled nodemon several times, keep getting the same error, even when I run it directly in the console. Thanks!
I see issue in the npm script. You should just update it to nodemon server.js
Related
i did a fresh "npm init".
put entry point : "index.html"
then installed lite-server : npm install lite-server --save-dev
also updated the package.json
{
"name": "newjs",
"version": "1.0.0",
"description": "nothing",
"main": "index.html",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start" : "npm run lite",
"lite" : "lite-server"
},
"author": "",
"license": "ISC",
"devDependencies": {
"lite-server": "^2.3.0"
}
}
But when I did "npm start" , getting this error
D:\mudit\newjs>npm start
newjs#1.0.0 start D:\mudit\newjs
npm run lite
> newjs#1.0.0 lite D:\mudit\newjs
> lite-server
Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults...
** browser-sync config **
{ injectChanges: false,
files: [ './**/*.{html,htm,css,js}' ],
watchOptions: { ignored: 'node_modules' },
server: { baseDir: './', middleware: [ [Function], [Function] ] } }
D:\mudit\newjs\node_modules\lite-server\node_modules\browser-sync\node_modules\socket.io\node_modules\engine.io\node_modules\ws\index.js:9
const WebSocket = require('./lib/WebSocket');
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Server.init (D:\mudit\newjs\node_modules\lite-server\node_modules\browser-sync\node_modules\socket.io\node_modules\engine.io\lib\server.js:115:16)
at new Server (D:\mudit\newjs\node_modules\lite-server\node_modules\browser-sync\node_modules\socket.io\node_modules\engine.io\lib\server.js:65:8)
at Function.attach (D:\mudit\newjs\node_modules\lite-server\node_modules\browser-sync\node_modules\socket.io\node_modules\engine.io\lib\engine.io.js:123:16)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "lite"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! newjs#1.0.0 lite: `lite-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the newjs#1.0.0 lite script 'lite-server'.
npm ERR! This is most likely a problem with the newjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! lite-server
npm ERR! You can get their info via:
npm ERR! npm owner ls newjs
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\mudit\newjs\npm-debug.log
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! newjs#1.0.0 start: `npm run lite`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the newjs#1.0.0 start script 'npm run lite'.
npm ERR! This is most likely a problem with the newjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run lite
npm ERR! You can get their info via:
npm ERR! npm owner ls newjs
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\mudit\newjs\npm-debug.log
Please Help as I am not even able to get the lite-server running.
thanks in advance.
package.json
"name": "billingapp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"rebuild": "electron-rebuild -f -w billingapp"
},
"author": "S Kundu",
"license": "ISC",
"dependencies": {
"electron": "^1.7.11",
"sqlite3": "^3.1.13"
}
"devDependencies": {
"electron-rebuild": "^1.7.3"
}
index.js
const electron = require('electron');
const path = require('path');
const url = require('url');
var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(path.join(__dirname, 'sample.db'));
const {app, BrowserWindow, Menu, ipcMain} = electron;
let mainWindow;
app.on('ready', function(){
// Create the login window
mainWindow = new BrowserWindow({
resizable: true,
fullscreen: false
});
// Load html in window
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'login.html'),
protocol: 'file:',
slashes: true
}));
});
login.html
<h1>Welcome to billing system</h1>
These are the code files.
Steps to install NPM Packages
npm install electron
npm install sqlite3
Its working perfect when I remove bellow code:
var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(path.join(__dirname, 'sample.db'));
But with this code , while running
npm start
is getting bellow error:
App threw an error during load
Error: Cannot find module
'C:\Users\sintu\Desktop\BillingSystem\node_modules\sqlite3\lib\binding\electron-v1.7-win32-x64\node_sqlite3.node'
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename (C:\Users\sintu\Desktop\BillingSystem\node_modules\electron\dist\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (C:\Users\sintu\Desktop\BillingSystem\node_modules\sqlite3\lib\sqlite3.js:4:15)
at Object. (C:\Users\sintu\Desktop\BillingSystem\node_modules\sqlite3\lib\sqlite3.js:190:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
when I run npm run rebuild , I get bellow error
× Rebuild Failed
An unhandled error occurred inside electron-rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Users\sintu\Desktop\billingApp\node_modules\sqlite3\build\deps\action_before_build.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\sintu\Desktop\billingApp\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\sintu\Desktop\billingApp\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--target=1.7.11" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" "--module_name=node_sqlite3" "--module_path=C:\Users\sintu\Desktop\billingApp\node_modules\sqlite3\lib\binding\electron-v1.7-win32-x64" "--host=https://mapbox-node-binary.s3.amazonaws.com" "--remote_path=./{name}/v3.1.13/{toolset}/" "--package_name=electron-v1.7-win32-x64.tar.gz"
gyp ERR! cwd C:\Users\sintu\Desktop\billingApp\node_modules\sqlite3
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Failed with exit code: 1
Error: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Users\sintu\Desktop\billingApp\node_modules\sqlite3\build\deps\action_before_build.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\sintu\Desktop\billingApp\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\sintu\Desktop\billingApp\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--target=1.7.11" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" "--module_name=node_sqlite3" "--module_path=C:\Users\sintu\Desktop\billingApp\node_modules\sqlite3\lib\binding\electron-v1.7-win32-x64" "--host=https://mapbox-node-binary.s3.amazonaws.com" "--remote_path=./{name}/v3.1.13/{toolset}/" "--package_name=electron-v1.7-win32-x64.tar.gz"
gyp ERR! cwd C:\Users\sintu\Desktop\billingApp\node_modules\sqlite3
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Failed with exit code: 1
at SafeSubscriber._error (C:\Users\sintu\Desktop\billingApp\node_modules\spawn-rx\lib\src\index.js:277:84)
at SafeSubscriber.__tryOrUnsub (C:\Users\sintu\Desktop\billingApp\node_modules\rxjs\Subscriber.js:239:16)
at SafeSubscriber.error (C:\Users\sintu\Desktop\billingApp\node_modules\rxjs\Subscriber.js:198:26)
at Subscriber._error (C:\Users\sintu\Desktop\billingApp\node_modules\rxjs\Subscriber.js:129:26)
at Subscriber.error (C:\Users\sintu\Desktop\billingApp\node_modules\rxjs\Subscriber.js:103:18)
at MapSubscriber.Subscriber._error (C:\Users\sintu\Desktop\billingApp\node_modules\rxjs\Subscriber.js:129:26)
at MapSubscriber.Subscriber.error (C:\Users\sintu\Desktop\billingApp\node_modules\rxjs\Subscriber.js:103:18)
at SafeSubscriber._next (C:\Users\sintu\Desktop\billingApp\node_modules\spawn-rx\lib\src\index.js:251:65)
at SafeSubscriber.__tryOrUnsub (C:\Users\sintu\Desktop\billingApp\node_modules\rxjs\Subscriber.js:239:16)
at SafeSubscriber.next (C:\Users\sintu\Desktop\billingApp\node_modules\rxjs\Subscriber.js:186:22)
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! billingapp#1.0.0 rebuild: electron-rebuild -f -w billingapp
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the billingapp#1.0.0 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sintu\AppData\Roaming\npm-cache_logs\2018-01-30T15_36_46_678Z-debug.log
it seems you have many problems with your scripts, but you also encountered a rare issue with sqlite.
0) You can find my Github source here that is working until this error :
Cannot read property 'on' of undefined
but that is another problem :D
1) Your package.json is not well formated (there is no start script for example)
New package.json
{ // there was no begining bracket
"name": "billingapp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"rebuild": "electron-rebuild -f -w billingapp",
"start": "node index.js" // new start script
},
"author": "S Kundu",
"license": "ISC",
"dependencies": {
"electron": "^1.7.11",
"sqlite3": "^3.1.0" // I used this version
},
"devDependencies": {
"electron-rebuild": "^1.7.3"
}
}
2) When I installed sqlite I encountered this issue https://github.com/mapbox/node-sqlite3/issues/758
It seems sqlite3 is not working with the last version of nodejs, so you need to install node#8.9.3 you can use nvm for that:
see comment on sqlite3 issue
treedbox commented on 20 Dec 2017
I am trying to run the vue-hackernews-2.0 example from vuejs' github repository
In setup section it explains how to install the project:
# install dependencies
npm install # or yarn
# serve in dev mode, with hot reload at localhost:8080
npm run dev
# build for production
npm run build
# serve in production mode
npm start
I did npm install. After changing the port to 8888 in server.js I typed "npm run dev" on command line.
> vue-hackernews-2.0# dev D:\Users\212399486\WebstormProjects\vue-hackernews-2.0-master
> node server
server started at localhost:8888
DONE Compiled successfully in 16328ms 1:02:18 PM
DONE Compiled successfully in 17845ms 1:02:19 PM
webpack built bd162a76119031a85eed in 17845ms
When I go localhost:8888 It will just try to load for 1 min and then it fails, without anything on the console.
I thought I should also try "npm run build" and "npm start" so I also used two commands. "npm run build" successfully created the dist file.
But after "npm start" I get this error:
> vue-hackernews-2.0# start D:\Users\212399486\WebstormProjects\vue-hackernews-2.0-master
> cross-env NODE_ENV=production node server
module.js:471
throw err;
^
Error: Cannot find module './dist/vue-ssr-server-bundle.json'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (D:\Users\212399486\WebstormProjects\vue-hackernews-2.0-master\server.js:41:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn node ENOENT
at notFoundError (D:\Users\212399486\WebstormProjects\vue-hackernews-2.0-master\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (D:\Users\212399486\WebstormProjects\vue-hackernews-2.0-master\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (D:\Users\212399486\WebstormProjects\vue-hackernews-2.0-master\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "D:\\Users\\212399486\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.11.2
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! vue-hackernews-2.0# start: `cross-env NODE_ENV=production node server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-hackernews-2.0# start script 'cross-env NODE_ENV=production node server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vue-hackernews-2.0 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=production node server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs vue-hackernews-2.0
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls vue-hackernews-2.0
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\Users\212399486\WebstormProjects\vue-hackernews-2.0-master\npm-debug.log
Screenshot of dist folder:
package.json scripts:
"scripts": {
"dev": "node server",
"start": "cross-env NODE_ENV=production node server",
"build": "rimraf dist && npm run build:client && npm run build:server",
"build:client": "cross-env NODE_ENV=production webpack --config build/webpack.client.config.js --progress --hide-modules",
"build:server": "cross-env NODE_ENV=production webpack --config build/webpack.server.config.js --progress --hide-modules"
},
Requires Node.js 7+
I managed to make it work without any problems.
$node -v
v8.3.0
$npm -v
5.3.0
Change the default port successfully :
To change the default port you have to edit package.json scripts:
dev: cross-env PORT=8888 node server
start: cross-env PORT=8888 NODE_ENV=production node server
Then running npm run dev
> vue-hackernews-2.0# dev /home/emx/so/vue-hackernews-2.0
> cross-env PORT=8888 node server
server started at localhost:8888
you are using a version of node that is not supported. Your error point to node v6.11.2 see below.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "D:\\Users\\212399486\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.11.2
npm ERR! npm v3.10.8
vue-hackernews-2.0 requires Node.js 7+. Upgrade your node to a 7+ version and you should be fine. I'll also recommend to update your npm version.
See the answers to this question for details about how to update your node version, if you need instructions.
I have started with electron today and followed a guide to create a simple application browser window and I ran npm start in the command window and it displayed a lot of errors after I had entered it, I have posted the information below and my code.
Console error:
C:\Users\Administrator\Desktop\electron>npm start
> breef#1.0.0 start C:\Users\Administrator\Desktop\electron
> node index.js
module.js:471
throw err;
^
Error: Cannot find module 'app'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\Administrator\Desktop\electron\index.js:1:73)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! breef#1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the breef#1.0.0 start script 'node index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the breef package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs breef
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls breef
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Administrator\Desktop\electron\npm-debug.log
Here is my package.json:
{
"name": "breef",
"version": "1.0.0",
"description": "A simple chat application.",
"main": "index.js",
"dependencies": {
"electron": "^1.4.12"
},
"devDependencies": {},
"scripts": {
"test": "breeftestcmd",
"start": "node index.js"
},
"keywords": [
"breef"
],
"author": "Sage & Sh4wn",
"license": "ISC"
}
Here is my index.js:
var app = require("app")
var browserWindow = require("browser-window")
app.on('ready', function() {
var mainWindow = new browserWindow({
width: 800,
height: 600
})
mainWindow.loadUrl('http://google.com');
})
If app is a module, it's missing in your package.json. If not, you should use a path to require it
var app = require('./app');
The guide you followed is out of date, as of Electron v1.0.0 the way built-in Electron modules are imported has changed. This is the correct way:
const {app, BrowserWindow} = require("electron")
You may also find it beneficial to read the previous question that covered this topic: What's the proper way to require in Node.js?
I stumbled upon this error when trying to start my application via NPM start. I am not sure where the problem lies, because it worked fine in my other computer (I unzip the file to this computer ran, npm install just in case and then tried to start it, but then the following error is thrown below).
Any help would be appreciated.
module.js:340
throw err;
^
Error: Cannot find module './'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/mnt/c/Users/Jonathan/Desktop/client/<NAME>/node_modules/.bin/electron:3:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v0.10.46
npm ERR! npm v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! <NAME>#0.0.0 start: `electron main.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the <NAME>#0.0.0 start script 'electron main.js'.
npm ERR! This is most likely a problem with the <NAME> package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron main.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs <NAME>
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls <NAME>
npm ERR! There is likely additional logging output above.
package.json
{
"name": "<NAME>",
"version": "0.0.0",
"description": "[..]",
"main": "index.js",
"build": {
"appId": "test.321",
"app-category-type": "your.app.category.type",
"win": {
"iconUrl": "http://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png"
}
},
"scripts": {
"start": "electron main.js",
"postinstall": "install-app-deps",
"pack": "build --dir",
"dist": "build"
},
"author": "john#gmail.com>",
"license": "ISC",
"devDependencies": {
"electron": "^1.3.3",
"electron-installer-squirrel-windows": "^1.3.0",
"electron-packager": "^7.5.1"
}
}
UPDATE
After solving the above error, the following error is thrown
I am running this through bash on windows 10, and have tried to install all required libraries to get the electron app to start via npm start on windows (works fine in my ubuntu)
electron main.js
[8002:0814/084446:FATAL:render_sandbox_host_linux.cc(40)] Check failed: 0 == shutdown(renderer_socket_, SHUT_RD). shutdown: Invalid argument
#0 0x000001e098ce <unknown>
#1 0x000001e1f4db <unknown>
#2 0x000001e1fa9d <unknown>
#3 0x000002892fc2 <unknown>
#4 0x00000265e599 <unknown>
#5 0x000002664b5f <unknown>
#6 0x00000265dc36 <unknown>
#7 0x000001204157 <unknown>
#8 0x000001202c30 <unknown>
#9 0x0000033a9470 main
#10 0x7fe5ec701f45 __libc_start_main
#11 0x000000575039 <unknown>
The shutdown check fail is a known issue. Electron runs just fine as a native Windows app, so just do that instead of over-complicating things with Bash on Windows.