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

Error on Windows: http-server #5

Closed
rfikki opened this issue Mar 24, 2017 · 7 comments
Closed

Error on Windows: http-server #5

rfikki opened this issue Mar 24, 2017 · 7 comments

Comments

@rfikki
Copy link

rfikki commented Mar 24, 2017

npm ERR! node v7.4.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! EthereumExplorerV2@0.1.0 start: http-server ./app -a localhost -p 8000 -c-1
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the EthereumExplorerV2@0.1.0 start script 'http-server ./app -a localhost -p 8000 -c-1'.
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 EthereumExplorerV2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! http-server ./app -a localhost -p 8000 -c-1
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs EthereumExplorerV2
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls EthereumExplorerV2
npm ERR! There is likely additional logging output above.

@metaspartan
Copy link
Owner

http-server is a npm package that this app relys on as a dependency, so you would want to run this app with just a "npm start" after you do an "npm install" the npm install will install its required dependencies.

You usually would want to start with via a "npm start" just in the main directory.

You could also try a "cd /app" to get into the main directory and then a "node app.js" and let me know what happens for you.

If you are wanting to change ports etc. I would recommend just setting up a reverse NGINX proxy server and setup to run on port 80 and to run the app from 8080.

@rfikki
Copy link
Author

rfikki commented Mar 28, 2017

Yes, I did do an "npm install" and then an "npm start". That is what gave me the error above. I did as you suggested and cd to the app directory. I then did the "node app.js" as you suggested. I got this error:

:\projects\dapps\explorer-master>cd app

c:\projects\dapps\explorer-master\app>node app.js
c:\projects\dapps\explorer-master\app\app.js:13
var WL=window.location;
^

ReferenceError: window is not defined
at Object. (c:\projects\dapps\explorer-master\app\app.js:13:8)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3

@rfikki
Copy link
Author

rfikki commented Mar 28, 2017

here is the log when doing "npm start":
https://gist.github.com/rfikki/61f0ddf493e818449ce03600b6d2de8a

@metaspartan
Copy link
Owner

metaspartan commented Mar 28, 2017

Try using a different version of nodejs like v6.x, Let me know your log output from that from doing an npm start after downgrading your version.

Make sure your also running an npm install and bower install before doing npm start, if you look in the node_modules folder do you see a list of different modules?

@susmit-git
Copy link

I ran the following command
npm install

It gave me error that not able to find bower. So I ran this
npm install -g bower (this installed bower)
npm install

Then executed following command
npm start

It gave me error that not able to find http-server. So I ran this
npm install -g http-server
npm start

Here is the output - So it worked
Starting up http-server, serving ./app
Available on:
http://localhost:8000

It connected to my private blockchain network. Now able to view all the blocks, accounts and transactions.

Will be exploring it more and if face any issue will share.

# Thanks for your great efforts!

@metaspartan
Copy link
Owner

Awesome, I would make sure you do a "bower install" after running npm install and before npm start, you shouldn't have to install http-server globally.

@rfikki
Copy link
Author

rfikki commented Mar 31, 2017

Thanks will give that a try!!! Okay, that worked. Such a simple solution!!!

hayooucom pushed a commit to hayooucom/explorer that referenced this issue Apr 23, 2021
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

3 participants