Can't run npm start: errno 1
I am working on Win 10 64bit. I have installed the latest Nodejs and the windows build tools via npm. I cloned the repo and did "npm install".
I get the following error on "npm start":
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 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing
7 info lifecycle [email protected]~start: [email protected]
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~start: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;F:\Code\electron-quick-start\node_modules.bin;C:\Program Files\Docker\Docker\Resources\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Boxcryptor\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Yarn\bin;C:\Program Files\nodejs;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Users\tico\AppData\Local\Microsoft\WindowsApps;C:\Users\tico\AppData\Local\atom\bin;C:\Users\tico\AppData\Local\Yarn\bin;C:\Users\tico\AppData\Roaming\npm
10 verbose lifecycle [email protected]~start: CWD: F:\Code\electron-quick-start
11 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'electron .' ]
12 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: electron .
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.electron .
23 error Exit status 1
24 error Failed at the [email protected] start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
I get the same thing...(only on windows10 64bit, works in ubuntu16.04).
+ git clone ..
+ npm install
+ npm start
I can see an electron process in task manager but no electron window/app launches. If I terminated the process then I get this
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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\Ben\AppData\Roaming\npm-cache\_logs\2017-06-18T18_17_45_289Z-debug.log
Inspecting the logs reveals the same stack trace as @tico86
Note that I get the same thing when trying to launch a simple app with electron-prebuilt-compile and using npm start or electron ./app/main.js. So its most likely some npm/windows weirdness.
Same here please help us solve this problem
when I use npm start it shows me same bug
Hey, i found the solution for me. The error occured when i used the a terminal plugin directly from the atom editor. When i run "npm start" directly in Powershell all works fine.
Had same problem when running from terminal in atom, @tico86 solution to run directly from powershell worked for some reason, annoying tough.
Same problem but was unable to solve using powershell, any other solutions?
Same problem but for deploy. I use yarn [https://yarnpkg.com/lang/en/] instead of npm and that work for me .
Like : yarn run instead of npm run
Anyone Found a solution yet? I get the same problem on windows 10
npm run build-sw works fine but npm start gives error
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: npm run build-sw && ./node_modules/.bin/webpack-dev-server --progress --host 0.0.0.0 --no-info --watch-poll
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
elrapha Do you try to use YARN ?
@steven-dev I would not know where to start with that. this project is a legacy software that has been running in ubuntu . I have a windows machine so i am trying to get it to work the same in windows.
Unless i just need to install yarn and run some sort of command then i can try that now. But if there are configurations involved I would have to research more into that...
@steven-dev Thanks for the tip Yarn worked for me. I had to install Visuall C++ first but after that just typing these two commands. My server is now running. Didnt have to touch any config files
yarn yarn run start
Good ;)
I would still typically recommend PowerShell for the commands or try running in the Ubuntu subsystem on the windows 10 update 1709 from which I've been doing the testing over at node.
Had same problem too. I solved it by run "npm install " before executes “npm run build”.
Had the same issue. Switched to yarn by simply running in a terminal window inside my project: yarn (instead of npm i). When that was done I ran my front end script yarn run build (instead of npm run build) and my backend script yarn start (instead of npm start). Well instead of getting that mysterious
code ELIFECYCLE
npm ERR! errno 1
error, this time, with yarn, I got Error: Cannot find module './routes/training'. Much more explicit (the error). Indeed I had made a typo in my routes. So fixed my typo. Saved and ran again yarn start and I was back in business.
If you've installed electron globally with npm, then you will only need to run the following in your app's source directory:
electron .
If you've installed it locally, then run: macOS / Linux
$ ./node_modules/.bin/electron .
Windows
$ .\node_modules\.bin\electron .
Node v8.2.0 and later
$ npx electron .
Given solutions posted above, especially that by @MahMoos, i'm going to go ahead and close this. Feel free to ping me if issues persist!
You got to run below command first to run development webpack server with the output of the build. This server don't open automatically an instance of electron.
npm start
After that you execute one more command:
npm run electron
@codebytere
I try run follow and not error :
./node_modules/.bin/electron .
or
npx electron .
But, electron is not start up. Like this :
root@ubuntu:/var/project/vpn# sudo ./node_modules/.bin/electron . root@ubuntu:/var/project/vpn# sudo ./node_modules/.bin/electron . root@ubuntu:/var/project/vpn# npx electron . root@ubuntu:/var/project/vpn# sudo npx electron . root@ubuntu:/var/project/vpn# sudo npx electron . root@ubuntu:/var/project/vpn# ps aux |grep electron root 6837 0.0 0.1 13136 1028 pts/0 S+ 03:39 0:00 grep --color=auto electron
Ubuntu:
sudo lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04 LTS Release: 18.04 Codename: bionic
uname -r 4.15.0-20-generic
I've had a similar problem, and I've solved it, as follows
$ npm install electron -g
$ npm start