grimmer0125 / markdown-preview-kramdown

An Atom package which lets you preview Kramdown files (a kind of markdown and used by GitHub Pages). It is modified from Markdown Preview. https://atom.io/packages/markdown-preview-kramdown
MIT License
5 stars 0 forks source link

Unable to install #1

Closed sxlijin closed 7 years ago

sxlijin commented 8 years ago

I just ran into the following error while attempting to install the package. I'm running Windows 7 x64 (and I do have Kramdown installed - at least gem install kramdown worked without any problems), although I don't have VS installed - are these dependencies that the user is expected to have?

The closest I could find to a solution was this, but that user already has VS.

INFO: Could not find files for the given pattern(s).

The system cannot find the file specified.

> oniguruma@5.1.2 install %USERPROFILE%\AppData\Local\Temp\apm-install-dir-116827-6108-1qzuaij\node_modules\markdown-preview-kramdown\node_modules\oniguruma
> node-gyp rebuild

%USERPROFILE%\AppData\Local\Temp\apm-install-dir-116827-6108-1qzuaij\node_modules\markdown-preview-kramdown\node_modules\oniguruma>if not defined npm_config_node_gyp (node "%USERPROFILE%\AppData\Local\atom\app-1.10.2\resources\app\apm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "%USERPROFILE%\AppData\Local\atom\app-1.10.2\resources\app\apm\bin\\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.  [%USERPROFILE%\AppData\Local\Temp\apm-install-dir-116827-6108-1qzuaij\node_modules\markdown-preview-kramdown\node_modules\oniguruma\build\binding.sln]
%USERPROFILE%\AppData\Local\Temp\apm-install-dir-116827-6108-1qzuaij
`-- (empty)
grimmer0125 commented 8 years ago

@sxlijin Sorry that I did not test this package on windows ever. I don't have windows machine/VM installed so that I can debug this very soon. This package is modified from markdown-preview written by Atom officially and I didn't add additional dependencies.

Fortunately, another package, markdown-preview-plus is also based on markdown-preview and there is an issue which seems the same as what you happen. https://github.com/Galadirith/markdown-preview-plus/issues/31. They indeed install something of Visual Studio Express 2013. You can search @Galadirith in that issue discussion. I believe this issue is from Atom itself or its official markdown-preview.

grimmer0125 commented 8 years ago

@sxlijin I installed win10 enterprise 64 and got installation error,

Same: oniguruma@5.1.2 Difference: errors mesages other than yours(error MSB3428).

The cause is that the original markdowm preview uses oniguruma, https://github.com/atom/node-oniguruma/blob/master/binding.gyp, which is a native binding library. Thefore it needs some library fo Visual Studio to do native-rebuild.

So the steps of the possible solution (worked on my win10 case) is

  1. Install python 2.7. (optional, if you choose optiona1 of the below, it will install python too)
  2. Install the required tools of node-gyp (Node.js native addon build tool). Instruction: https://github.com/nodejs/node-gyp#installation. In this instruction, there are two options, I choose its optiona1,

On Windows:

Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).

p.s. using optiona1 needs to use npm package not supplied by atom. Therefore you need to install Node.js & NPM first.