I am somewhat of a novice, so forgive me if I have done something stupid. I have a Windows 8 machine, I installed nodejs, and at the command prompt in Administrator mode I executed “npm install -g spark-cli”.
This is what happened:
Make sure you’re using the Node.js command prompt in the Node.js folder in the start menu. Node.js apparently doesn’t permanently modify your system path to be able to run packages from the normal command prompt, but when you run the Node.js command prompt, you should be able to run npm packages.
I guess it does permanently modify your path then. I think you must have to run that once to get the path set up, though. I seem to remember having this problem the first time I tried to run it with the normal command prompt and I’ve just been using the Node.js command prompt ever since.
Thanks to all of you for your advice. I have moved node.js to the start menu, and checked the PATH which does include a path name for nmp. To be honest, I am not sure what node.js is - am I supposed to be running the spark cli from this, i.e. opening nodejs and then typing “spark cloud login”? I tried that and I just get a “…” prompt (for everything I then type!). So, I suspect that is NOT the thing to do!
Assuming that the Windows cmd.exe is where I should execute “spark cloud login”, I am still stuck. Can I modify the PATH so that the reference to “spark” is valid…and to what??
Thanks, guys, I know I am a bit of a dummy when it comes to all this stuff.
You should see Node.js and Node.js command prompt both in the start menu. You can try running the one that says Node.js command prompt, but since npm is already in your path, that may not help.
It should have installed the files in C:\Users\<username>\AppData\Roaming\npm, so you can open that folder and see if you see spark.cmd. You’ll have to click on the View tab and check Hidden Items in Explorer first (AppData is a hidden folder). If spark.cmd is there, you should be able to run %appdata%\npm\spark cloud login from a cmd.exe window. If the files are not there, then it didn’t install properly. You may want to try installing it again without running cmd.exe as administrator.
This is what I have in the c:\Users\User\AppData\Roaming\npm file (after un-hiding everything):
. That’s after re-executing “npm install -g spark-cli” as non-administrator (it wasn’t there when I did it as Adminstrator, either).
Now, in the node-modules folder there is a spark-cli folder, but no spark.cmd there, only a spark.js file.
Interestingly, when I click on this the message comes up that it will not run on my computer…it is a 64 bit machine running Windows 8 and I have had this problem before.
I get an error message that relates to the problem at the very beginning of my initial query: the install failure of the serial port module. See below:
It doesn’t seem to recognise ‘cloud’ either which may be related. I read the post “Troubles installing node-serialport during the spark-cli install on Windows” and installed Visual Studio 2013, and I removed Python altogether because I don’t use it… Still no luck.
The message after the command line is saying that it cannot find a file in a folder v1.4.5 (the rest of the path doesn’t much exist after npm either). I have looked throughout the folders in npm to do with serialport and I can only find references to v1.4.3 buried in a path under folders such as ‘webgeek’ and ‘node-v11-darwin-x64’. I just don’t seem to have the right files… I really am at loss as to what to do and, frankly, why it’s necessary to have a PhD in Windows to install this: all I wanted to do was play with the Spark Core remotely! Here’s a screen shot of the latest…
Thanks - I went through the tutorial again (I removed everything and started again). All in 32 bit. You can see below the result when I called up node.js command prompt and ran the install - prob with the serialport load, again. Also, you’ll see that it doesn’t recognise ‘spark’ when I enter the next command.
Any ideas gratefully received! Thanks, again.
What you see is the end of the the command: npm install -g serialport --verbose. I looked through it and didn’t see any errors, but I cannot see the whole output because it exceeds the screen buffer. It’s pretty much all Greek to me.