electron-quick-start icon indicating copy to clipboard operation
electron-quick-start copied to clipboard

Can't run npm start: errno 1

Open tico86 opened this issue 9 years ago • 34 comments

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. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:283:16) 14 verbose stack at emitTwo (events.js:125:13) 14 verbose stack at EventEmitter.emit (events.js:213:7) 14 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14) 14 verbose stack at emitTwo (events.js:125:13) 14 verbose stack at ChildProcess.emit (events.js:213:7) 14 verbose stack at maybeClose (internal/child_process.js:897:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5) 15 verbose pkgid [email protected] 16 verbose cwd F:\Code\electron-quick-start 17 verbose Windows_NT 10.0.15063 18 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start" 19 verbose node v8.1.1 20 verbose npm v5.0.3 21 error code ELIFECYCLE 22 error errno 1 23 error [email protected] start: 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 ]

tico86 avatar Jun 15 '17 12:06 tico86

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.

benoitroy avatar Jun 18 '17 18:06 benoitroy

Same here please help us solve this problem

MistaZidane avatar Aug 12 '17 08:08 MistaZidane

when I use npm start it shows me same bug

MistaZidane avatar Aug 12 '17 08:08 MistaZidane

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.

tico86 avatar Aug 14 '17 07:08 tico86

Had same problem when running from terminal in atom, @tico86 solution to run directly from powershell worked for some reason, annoying tough.

Trillobit avatar Sep 21 '17 16:09 Trillobit

Same problem but was unable to solve using powershell, any other solutions?

judemanutd avatar Oct 19 '17 16:10 judemanutd

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

steven-dev avatar Oct 20 '17 14:10 steven-dev

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 avatar Nov 09 '17 15:11 elrapha

elrapha Do you try to use YARN ?

steven-dev avatar Nov 09 '17 16:11 steven-dev

@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...

elrapha avatar Nov 09 '17 19:11 elrapha

@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

elrapha avatar Nov 09 '17 20:11 elrapha

Good ;)

steven-dev avatar Nov 10 '17 09:11 steven-dev

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.

ColinMoulds avatar Nov 13 '17 14:11 ColinMoulds

Had same problem too. I solved it by run "npm install " before executes “npm run build”.

DUDUfine avatar Dec 28 '17 07:12 DUDUfine

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.

cjpillette avatar Jan 09 '18 10:01 cjpillette

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 .

MahMoos avatar Jan 20 '18 12:01 MahMoos

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!

codebytere avatar May 07 '18 18:05 codebytere

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

tunminster avatar Aug 30 '18 09:08 tunminster

@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

flftfqwxf avatar Sep 24 '18 07:09 flftfqwxf

I've had a similar problem, and I've solved it, as follows

$ npm install electron -g
$ npm start

Yangfan2016 avatar Oct 25 '18 03:10 Yangfan2016