nfroidure/gulp-iconfont

Unable to install on windows (Can't find Python executable "python")

Closed this issue · 6 comments

Possibly some documentation can solve this. I suspect I need to install python first?

C:\temp>npm install gulp-iconfont
-
> ttf2woff2@2.0.1 install C:\temp\node_modules\gulp-iconfont\node_modules\gulp-t
tf2woff2\node_modules\ttf2woff2
> (node-gyp rebuild > builderror.log) || (exit 0)

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:71:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\temp\node_modules\gulp-iconfont\node_modules\gulp-ttf2woff2\node
_modules\ttf2woff2
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
gulp-iconfont@5.0.0 node_modules\gulp-iconfont
├── gulp-cond@1.0.0 (readable-stream@2.0.2)
├── streamfilter@1.0.5 (readable-stream@2.0.2)
├── plexer@1.0.1 (isstream@0.1.2, readable-stream@2.0.2)
├── gulp-ttf2eot@1.1.0 (bufferstreams@1.1.0, readable-stream@2.0.2, ttf2eot@1.3.
0)
├── gulp-ttf2woff@1.1.0 (bufferstreams@1.1.0, readable-stream@2.0.2, ttf2woff@1.
3.0)
├── gulp-util@3.0.7 (array-uniq@1.0.2, array-differ@1.0.0, fancy-log@1.1.0, beep
er@1.1.0, lodash._reevaluate@3.0.0, lodash._reescape@3.0.0, lodash._reinterpolat
e@3.0.0, object-assign@3.0.0, replace-ext@0.0.1, minimist@1.2.0, has-gulplog@0.1
.0, vinyl@0.5.3, gulplog@1.0.0, chalk@1.1.1, lodash.template@3.6.2, through2@2.0
.0, multipipe@0.1.2, dateformat@1.0.11)
├── gulp-spawn@0.3.0 (plexer@0.0.1, gulp-util@2.2.20)
├── gulp-svg2ttf@1.1.4 (bufferstreams@1.1.0, readable-stream@2.0.2, svg2ttf@2.0.
2)
├── gulp-svgicons2svgfont@2.4.0 (readable-stream@2.0.2, svgicons2svgfont@3.2.0)
└── gulp-ttf2woff2@2.0.0 (bufferstreams@1.1.0, readable-stream@2.0.2, ttf2woff2@
2.0.1)
C:\temp>

After installing Python 2.7 I got a new errror

C:\temp>npm install gulp-iconfont
-
> ttf2woff2@2.0.1 install C:\temp\node_modules\gulp-iconfont\node_modules\gulp-t
tf2woff2\node_modules\ttf2woff2
> (node-gyp rebuild > builderror.log) || (exit 0)

gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\temp\node_modules\gulp-iconfont\node_modules\gulp-ttf2woff2\node
_modules\ttf2woff2
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
gulp-iconfont@5.0.0 node_modules\gulp-iconfont
├── plexer@1.0.1 (isstream@0.1.2, readable-stream@2.0.2)
├── streamfilter@1.0.5 (readable-stream@2.0.2)
├── gulp-cond@1.0.0 (readable-stream@2.0.2)
├── gulp-ttf2eot@1.1.0 (bufferstreams@1.1.0, readable-stream@2.0.2, ttf2eot@1.3.
0)
├── gulp-ttf2woff@1.1.0 (bufferstreams@1.1.0, readable-stream@2.0.2, ttf2woff@1.
3.0)
├── gulp-util@3.0.7 (array-differ@1.0.0, array-uniq@1.0.2, fancy-log@1.1.0, beep
er@1.1.0, lodash._reescape@3.0.0, lodash._reinterpolate@3.0.0, object-assign@3.0
.0, lodash._reevaluate@3.0.0, replace-ext@0.0.1, minimist@1.2.0, has-gulplog@0.1
.0, vinyl@0.5.3, gulplog@1.0.0, chalk@1.1.1, through2@2.0.0, lodash.template@3.6
.2, multipipe@0.1.2, dateformat@1.0.11)
├── gulp-spawn@0.3.0 (plexer@0.0.1, gulp-util@2.2.20)
├── gulp-svgicons2svgfont@2.4.0 (readable-stream@2.0.2, svgicons2svgfont@3.2.0)
├── gulp-svg2ttf@1.1.4 (bufferstreams@1.1.0, readable-stream@2.0.2, svg2ttf@2.0.
2)
└── gulp-ttf2woff2@2.0.0 (bufferstreams@1.1.0, readable-stream@2.0.2, ttf2woff2@
2.0.1)

C:\temp>

Build errors doesn't mean install error. There's a JavaScript fallback when the build fails (and it is most of the time the case for Windows users).

You can still use gulp-iconfont either by not using the woff2 format or by using it with the Emscripten fallback.

Or, you can make it build on Windows, i'll accept any PR allowing it and explaining the needed setup to do so.

Ok. Either way I suggest writing about this in your README unless you want this issue to repeat itself in the future as most users might expect it to install/build on windows as well ;)

@SubZane feel free to PR ;)

this article helps me https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/

npm config set python /Python27/python.exe --global
npm config set msvs_version 2010 --global

\node_modules\_ttf2woff2@2.0.3@ttf2woff2\jssrc\ttf2woff2.js

search throw ex to /*throw ex*/

1111