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

npm start failed with the following error - NPM and Nodejs are latest versions. #2

Open
amarknair opened this issue May 1, 2016 · 29 comments

Comments

@amarknair
Copy link

amarknair commented May 1, 2016

When I tried executing npm start it failed with the following error. NPM and Nodejs are latest versions. I am trying this on Ubuntu 16.04 64-bit.

TurkerGaze@0.0.2 start /home/amar/Desktop/Gaze Detector/TurkerGaze-master
node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js

sh: 1: node: not found

npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! TurkerGaze@0.0.2 start: node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the TurkerGaze@0.0.2 start script 'node ./node_modules/webpack-dev-server/bin/webpack-dev-server.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 TurkerGaze package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs TurkerGaze
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls TurkerGaze

npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/amar/Desktop/Gaze Detector/TurkerGaze-master/npm-debug.log

Can somebody help me with this

@xksteven
Copy link

xksteven commented May 2, 2016

Did you install webpack with npm?

@amarknair
Copy link
Author

Yes I did. Sorry for the late response.

@xksteven
Copy link

Can you explain what you're doing here?
node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js
You can run
"npm start"
at the root directory of the git repo and it should start node without errors.

@amarknair
Copy link
Author

Now when I am trying to execute npm-install, I get the following messages.

amarnair@CECSTahdfi:/var/www/TurkerGaze-master$ npm start

TurkerGaze@0.0.2 start /var/www/TurkerGaze-master
node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js

http://localhost:8080/webpack-dev-server/
webpack result is served from /
content is served from ./
404s will fallback to /index.html
Hash: ca7616af249742709dcb
Version: webpack 1.13.0
Time: 470ms
Asset Size Chunks Chunk Names
bundle.js 1.69 kB 0 [emitted] main
chunk {0} bundle.js (main) 55 bytes [rendered]
[0] multi main 28 bytes {0} [built]
[1] ./src/index.js 27 bytes {0} [built] [1 error]

ERROR in ./src/index.js
Module not found: Error: Cannot resolve module 'script' in /var/www/TurkerGaze-master/src
@ ./src/index.js 1:0-26
webpack: bundle is now VALID.

@amarknair
Copy link
Author

I think the problem is with my Webcam. If I fix it and run the 'pugazetrckr.html' file, will it run?

@xksteven
Copy link

does this file pugazetrckr.html exist?
I couldn't get much further than that. I never got it to completely start with node. I'm not sure what "script" he refers to in that file.

@amarknair
Copy link
Author

No it doesn't exist. The readme file is confusing actually.

@heliumsoule
Copy link

Has anyone figured out how to run this project? I went to http://localhost:8080/webpack-dev-server/, but all it tells me is "App Ready", and redirects me back to index.html which is correct (I think).

But then, it tells me Webcam is not defined in the index.html page.

@amarknair
Copy link
Author

When I try running the index.html file after creating a localhost, it tells there are no active hits now, come back later. Have you encountered the same problem?

@heliumsoule
Copy link

@amarknair, I copied the page source from pugazetrackr.html from their http://isun.cs.princeton.edu/TurkerGaze/pugazetrackr.html webpage and that gives me that error.

The original index.html source file which I downloaded today did not contain that error. Good way to check is the right file should contain the variable Webcam I believe.

I'm assuming they renamed pugazetrackr to index.

@amarknair
Copy link
Author

Yes, even I think they renamed the file. But I did not understand what you meant by "right file should contain the variable Webcam I believe." Sorry, I am very new to web-development.

@heliumsoule
Copy link

heliumsoule commented May 17, 2016

No worries. I have more experience with mobile development too. The part of their index.html file which I'm having a headache with is

Webcam.set({ width: 640, height: 360, image_format: 'jpeg', jpeg_quality: 90 }); Webcam.attach( '#imgCanvas' );

on Lines 164-172. The error I'm receiving is that the Webcam variable cannot be resolved. That's because:

.../node_modules/webcamjs/webcam.js:718 }(window)); ^ ReferenceError: window is not defined

It depends on the window, which is a client side DOM element, which is not initialized when the server side JS creates the Webcam variable.

@amarknair
Copy link
Author

Thank you very much. I think I understood the issue with that.

@heliumsoule
Copy link

No worries. :) Let me know if you get it running. I'll post here too if I figure it out.

@amarknair
Copy link
Author

Yes sure, I will try to run it. I will post here too.

@heliumsoule
Copy link

@amarknair I got it working. Let me know if you're still working on this.

@amarknair
Copy link
Author

@heliumsoule Yes, I am. Could you tell me how you got it running?

@heliumsoule
Copy link

@amarknair It seems like they didn't put in the right html file. Save this html page and use it in place of index.html in the project folder. Then go into src, and comment out the line in index.js that requires webcamjs.

It should work now if you run npm start and go to the localhost:8080 domain.

@xksteven
Copy link

Thanks for the help!

@amarknair
Copy link
Author

@heliumsoule Thank you for the help. I will try it out in my system and let you know the result.

@heliumsoule
Copy link

No problem. Good luck with your projects.

On Tuesday, May 17, 2016, Steven Basart notifications@github.com wrote:

Thanks for the help!


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#2 (comment)

@amarknair
Copy link
Author

@heliumsoule It is working now. We have to try out the html page you mentioned.
Thanks for the help. :)

@amarknair
Copy link
Author

@xksteven @heliumsoule Are you able to completer the tracking? My camera is turning off abruptly after starting the application. So I am still not able to run it fully.

@heliumsoule
Copy link

@amarknair Sorry for the late responses. I am swamped with work for the next two days. Will look at this tomorrow evening. Thanks for being patient.

@heliumsoule
Copy link

@amarknair are you still experiencing issues?

@amarknair
Copy link
Author

@heliumsoule Yes I could solve the issue. It is not working with my laptop camera in chrome. When I tried with a USB webcam, it is working fine. This was due to a bug in chrome and chromium which is not solved yet.
https://bugs.chromium.org/p/chromium/issues/detail?id=470717&q=webcam%20ubuntu&colspec=ID%20Pri%20M%20Week%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified

@heliumsoule
Copy link

Okay phew that is good to hear. We'll be working with this framework in our lab for the next few months so let me know if anything else comes up!

@amarknair
Copy link
Author

Yes, sure. I will definitely post here. We are also going to work on the same framework. Keep in touch!!

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

4 participants
@heliumsoule @xksteven @amarknair and others