Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run npm start: errno 1 #155

Closed
tico86 opened this issue Jun 15, 2017 · 34 comments
Closed

Can't run npm start: errno 1 #155

tico86 opened this issue Jun 15, 2017 · 34 comments

Comments

@tico86
Copy link

tico86 commented Jun 15, 2017

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 npm@5.0.3
3 info using node@v8.1.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle electron-quick-start@1.0.0prestart: electron-quick-start@1.0.0
6 silly lifecycle electron-quick-start@1.0.0
prestart: no script for prestart, continuing
7 info lifecycle electron-quick-start@1.0.0start: electron-quick-start@1.0.0
8 verbose lifecycle electron-quick-start@1.0.0
start: unsafe-perm in lifecycle true
9 verbose lifecycle electron-quick-start@1.0.0start: 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 electron-quick-start@1.0.0
start: CWD: F:\Code\electron-quick-start
11 silly lifecycle electron-quick-start@1.0.0start: Args: [ '/d /s /c', 'electron .' ]
12 silly lifecycle electron-quick-start@1.0.0
start: Returned: code: 1 signal: null
13 info lifecycle electron-quick-start@1.0.0~start: Failed to exec start script
14 verbose stack Error: electron-quick-start@1.0.0 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 electron-quick-start@1.0.0
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 electron-quick-start@1.0.0 start: electron .
23 error Exit status 1
24 error Failed at the electron-quick-start@1.0.0 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

@benoitroy
Copy link

benoitroy commented Jun 18, 2017

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! electron-quick-start@1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-quick-start@1.0.0 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.

@MistaZidane
Copy link

Same here please help us solve this problem

@MistaZidane
Copy link

when I use npm start it shows me same bug

@tico86
Copy link
Author

tico86 commented Aug 14, 2017

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.

@Trillobit
Copy link

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

@judemanutd
Copy link

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

@steven-dev
Copy link

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

@elrapha
Copy link

elrapha commented Nov 9, 2017

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! adminfront@1.0.0 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 adminfront@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@steven-dev
Copy link

steven-dev commented Nov 9, 2017

elrapha Do you try to use YARN ?

@elrapha
Copy link

elrapha commented Nov 9, 2017

@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
Copy link

elrapha commented Nov 9, 2017

@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

@steven-dev
Copy link

Good ;)

@ColinMoulds
Copy link

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.

@DUDUfine
Copy link

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

@cjpillette
Copy link

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.

@MahMoos
Copy link

MahMoos commented Jan 20, 2018

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 .

@codebytere
Copy link
Member

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!

@tunminster
Copy link

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

@flftfqwxf
Copy link

flftfqwxf commented Sep 24, 2018

@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

@Yangfan2016
Copy link

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

$ npm install electron -g
$ npm start

@makhmoor
Copy link

I have a similar problem, and I've tried everything which is given in this issue #155 and still electron Browser Window won't open, Need help

@makhmoor
Copy link

I was using the latest version of nodejs 11 that's why it was not working. After installing the nodejs 10.13 version it worked for me. ISSUE SOLVED.

@CampaUTN
Copy link

In my case, there was a dead process at the same port and I got the same error. After killing the process it worked right

@ememumoh
Copy link

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

This work for me also!!

@ah3eyy
Copy link

ah3eyy commented Feb 6, 2019

I didnt have to do any of the aforementioned solution, i just had to check with my webpack.config file to see what was causing the error, npm run build made easy to narrow . then npm start works perfectly.
Thanks to u guys

@shshravan
Copy link


error

@shshravan
Copy link

please solve this problem

@houzaifkhan
Copy link

Hey I faced the same error
Try each & everything, the steps recommended by NPM & also stack overflow, nothing worked but here`s the simple solution which sorted out error
-Go to home directory delete "node_modules", ".npm" ".yarn" directory
-Update the Node version
-Go to react-app (directory you made), delete "node_module" (yarn.lock if there is)
-Enter "npm install" command to install the dependencies
-Enter "npm start"

-Cheers it will work

@shshravan
Copy link

Thank you
But this problem allready solved.
Poweshell path declaration problem.
After set powershell path problem is solved

@karthik2522
Copy link

git2
this my windows 10 64bit version 1809
i have downloaded Git Bash software
server running successfully

@ColinMoulds
Copy link

But your server isnt running an audio playback file this error is to do with audio

@NelsonMeza
Copy link

I solved it reinstalling npm install --save @types/react and npm install --save @types/react-dom

@cormac0108
Copy link

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

Same problem here. Please help!

@binary-ibex
Copy link

I solve My issue by
sudo apt-get install rpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests