Problems installing node.js connect package

I do not use the command prompt frequently (or, tbh, at all). The installation tutorial ( )is incomprehensible to me. I'm stuck at "Setting up a web server"; to be exact at point "2. Open a command shell in the Cesium root directory and install the connect package by executing npm install connect. This will create a ‘node_modules’ directory in the root directory."

I opened command prompt and changed diretory to D:/Downloads/Cesium (that's where I unpacked it) and then typed in "start npm install connect". There's no such program. I then tried to do the same in nodejs directory (C:/Program Files/nodejs). It did something there, but it certainly is not Cesium root directory.

I'm at a total loss as to what I should be doing. Please instruct me in a simpler way than "install the connect package by executing (...)", or make it more clear.

It sounds like npm isn’t on your PATH.

First, instead of “start npm install connect”, try typing “npm install connect” (from the Cesium directory). I don’t know if “start” messes with the environment in which it runs the child command, but it’s possible.

Also, keep in mind that, after an installer makes changes to your path, you need to open a new command prompt in order for the new PATH setting to take effect. Try closing your current command prompt windows, open a new one, navigate to the cesium directory, and try “npm install connect” again.

If that doesn’t fix it, it’s possible that your PATH environment variable simply never got updated. When you install node.js, there’s an option to add node and npm to your PATH. Ensure that you installed node with that option enabled (if necessary, uninstall node.js, reinstall node.js, kill and relaunch any command prompt sessions, and try again).

If you’re in an environment where you are unable to make changes to your system PATH (a locked-down work environment, for example), you should still be able to make changes to your user PATH. If none of the previous suggestions helped, post back and I’ll walk you through changing that.

If all else fails, you might be able to explicitly type the full path to npm. So instead of

npm install connect

you could try

“c:\Program Files\nodejs\npm” install connect

(note that the quotes are important here, and must be typed).

Hope that helps!

Did the "c:\Program Files\nodejs\npm" install connect and it worked, thanks!

Now another problem, similar to this one!topic/cesium-dev/DQAbstzUkH4

I run node server.js in root directory (still D:/Downloads/Cesium). It appears to work and does nothing in the command prompt (the aforementioned topic says it should not show anything). The problem is, I can't access http://localhost:8080/

What am I doing wrong this time?

When you run “node server.js” (or in your case, more likely, “C:\Program Files\nodejs\node” server.js), it should not only appear to do nothing, it should appear “stuck”. The command will produce no output, but it will also not exit. This is fine; it means that the server is running in the background. In order to terminate the server, you want to type “Ctrl-C” in that window. But not just yet.

While in this state, if you visit http://localhost:8080/ in your browser, you should get a page of links to various demos. Try clicking around.

If, when you ran “node server.js”, you were immediately greeted with another command prompt, then the server is not actually running. If that’s the case, we’ll need more details to diagnose your problem (i.e. I just tried it and it worked fine for me).