There is an issue https://github.com/SharePoint/sp-dev-docs/wiki/Setup-your-machine.
The installation of Python is only required on Windows but not on other systems.
In addition you need to install a C++ compiler or VC++ runtime on Windows. SPFX use node-gyp an doesn't work on Windows without those compilers.
When you have Visual Studio installed you don't have a problem because it installs a C++ compiler/runtime.
Node-gyp has a detailed documentation of prerequesits for Windows, Mac and Linux. see node-gyp
Chaks - can you clean up the "setting up your machine" steps?
Another issue that might make it hard for people that just getting started with nodejs and yeomen. I always write in my documentation the full command instead of the abbrivation.
npm install -g yo gulp
instead of
npm i -g yo gulp
Might makes it more clearer what the command does when someone just started with NodeJS and especially Yeoman.
installing the generator with npm i -g @microsoft/generator-sharepoint --no-optional gets rid of the missing python and c++ stuff - and as far as I can tell, I can run everything just fine.
FYI: I don't have python installed on my machine, and as far as C++ is concerned I might have some runtimes as they where installed by some other (MSI-based) installers.
@nyn3x --no-optional works fine on Windows tried it a couple of times but the problem is that some compilation times are much slower then they should be.
SASS compilation on large projects using the native Ruby-based implementation of SASS can cause 10 seconds or more.
The same source compiled with a native C-compiled SASS extension only took about 10 milliseconds.
Same thing applies to other components too. The reason for node-gyp is simply performance improvment with some extensions.
hmm - I see. That's not good, I haven't noticed as most my environments are missing python - so I don't know what I'm missing out on :)
OT: are the bad compilation times because of the missing node-gyp or because of the --no-optional flag?
I added a known issues doc highlighting the python issue. I tested in a fresh Windows machine and Mac to make sure they work.
@nyn3x Node-gyp is always installed when you install NodeJS. The question is will it work or break because of so called missing "development dependencies'. In other words Python and C++.
The rest is a little bit tricky to explain.
I think SASS in this case is a good example for this. You can install ruby and then use SASS the native way. The performance is somewhat good but you have the dependency on ruby.
To make SASS independant from the ruby installation the SASS team wrote a native C++ component that does exactly the same job but faster. Naturally it is a C compiled code. This libsass library is used by most IDE such as VS Studio, VS Code, Atom, Sublime, ... you name it.
To be platform independent you have to compile the C++ source for each platform you are on or precompile. NodeJS solve this issue a little bit different because you can integrate any C++ or Phython writen code into NodeJS. This is exactly what node-gyp does. Compile native C++ or Python Scripts and make it available in NodeJS but compile it on the platform you are on.
The benefit: It just compiles no matter which version you are on.
You can even use Yeoman on a raspberry pie if you like. Pyhton and C++ are installed ther by default.
The problem is on Windows systems they are not installed there.
Node-gyp is pretty common in NodeJS development and is used by a lot of tools.
If you switch to --no-optional the native NodeJS code will be used instead of the performance optimized C++/Python code.
If you like to get the full experience on Windows you have to install Python 2.7 and C++. If not use -no-optional switch. In future the goal of Microsoft is to support it on Windows trough Visual Studio or if you don't like to use Visual Studio you can run a Linux subsystem on Windos aka 'Bash on Windows'
@chakkaradeep You might want to tweak the Phantomjs known issue to clarify that both the python directory and the scripts subdirectory need to be on the PATH.
I had 2.7.10 installed to c:\tools\python2 and that directory was already on the system PATH. I still got the error. Adding c:\tools\python2\scripts to the PATH cleared it up.
Incidentally, the 2.7.12 MSI installer adds both to the PATH if you select that option.
Closing this issue as the documentation has been updated.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Most helpful comment
Another issue that might make it hard for people that just getting started with nodejs and yeomen. I always write in my documentation the full command instead of the abbrivation.
npm install -g yo gulpinstead of
npm i -g yo gulpMight makes it more clearer what the command does when someone just started with NodeJS and especially Yeoman.