connectivedx / Phoenix

http://connectivedx.github.io/Phoenix/
33 stars 5 forks source link

Python dependency? #187

Closed pc-pdx closed 8 years ago

pc-pdx commented 8 years ago

Build problems afoot on azure hosted vm of win server2012R2 datacenter. There seems to be a surprise dependency on Python. This doesn't necessary mean there's an issue other than we should be aware of the dependency. Raising the flag here in case this is something that should be discussed more?

errr:

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:\WEBSITES\lift-dev\website\Assets\src\node _modules\gulp-sass\node_modules\node-sass\node_modules\pangyp\lib\configure.js:1 04:14) gyp ERR! stack at C:\WEBSITES\lift-dev\website\Assets\src\node_modules\gulp- sass\node_modules\node-sass\node_modules\pangyp\lib\configure.js:65:11 gyp ERR! stack at FSReqWrap.oncomplete (evalmachine.:82:15) gyp ERR! System Windows_NT 6.3.9600 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\WEBSITES\lift-dev\ website\Assets\src\node_modules\gulp-sass\node_modules\node-sass\node_mod ules\pangyp\bin\node-gyp" "rebuild" gyp ERR! cwd C:\WEBSITES\lift-dev\website\Assets\src\node_modules\gulp-sass\node _modules\node-sass gyp ERR! node -v v4.2.4 gyp ERR! pangyp -v v2.2.1 gyp ERR! not ok Build failed merge-stream@0.1.7 node_modules\merge-stream

kamsar commented 8 years ago

Interesting. I do not have Python installed and I've done builds of 2.2.1 recently.

Perhaps a npm package updated and added a dependency?

elseloop commented 8 years ago

Looks like pangyp was removed from node-sass last September, when that project was deprecated, and replaced with node-gyp. The version of gulp-sass defined in our most recent package, where this dependency is coming from, is only one minor release behind stable, and looks to include these updates from node-sass even in that version. My understanding of these projects is that they don't have Python dependencies either (but, you know, "my understanding" so...questionable).

What version of Phoenix is this happening on for you? Have you tried to delete the node_modules directory and npm install-ing (or running one of the build scripts) fresh? That usually helps to blow away any weird dependency conflicts.

pc-pdx commented 8 years ago

I'm attempting to run Phoenix 2.2.1 I can build locally but, of course, it's a big no go on the production server (liftcdx). I was able to reproduce this a few times and eventually did install python 2.7.0 in order to move on to the next error. I am no longer able to see this particular error referencing python post install... I DUNNO anything beyond that node-sass is a giant pain-in-the-sass.

Here's the gist for the full error log, fwiw.

In fairness, i did not blast the node_modules folder before the python install so it may well be covered by resolving some npm cache weirdness. The resolution for this particular issue, in this case was the python install tho'''.

pc-pdx commented 8 years ago

closed as weird. Two fresh checkouts against latest base have shown no issue.

elseloop commented 8 years ago

node-gyp put out a new release last week, the first since you opened this. Haven't read the changelog yet, but I'm guessing that may have addressed the issue.

pc-pdx commented 8 years ago

Ran into this again. It appears related togulp-sass via node-gyp( @v3.3.1) when node upgraded from <1.0 to 4+ noting headache for future pain relief,ihope. resolved by npm uninstall --save-dev gulp-sass npm install --save-dev gulp-sass@2

This does now, however, add other issues specific to the CTGR code, but the python issue is resolved.

OG output from the python issue:

(node) child_process: options.customFds option is deprecated. Use options.stdio instead.

D:\Websites_git-tester\Source\ctgr.fed\Assets\src\node_modules\gulp-sass\node_m odules\node-sass>if not defined npm_config_node_gyp (node "C:\Program Files\node js\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.j s" rebuild ) else (node "" rebuild ) 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:401:14) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node -gyp\lib\configure.js:356: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 D:\Websites_git-tester\Source\ctgr.fed\Assets\src\node_modules\gul p-sass\node_modules\node-sass gyp ERR! node -v v4.4.4 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok Build failed

kamsar commented 8 years ago

I think this occurs when node-sass fails at getting binaries for your OS and tries to run a build from source. Which requires python and a pretty specific VS setup (C++, et al, special configs if you don't have VS2013, etc). It's ugly.

elseloop commented 8 years ago

(Just to piggyback on this and help clarify for anyone else running up against it in the future.)

@kamsar is right about the cause of the issue, which is why we see it mostly on Windows machines, where there's no python by default. The failure seems to only happen with certain combinations of Node and gulp-sass versions being used together. As best as we can tell, if you're running a version of Node pre-4.0 (likely 0.10.x, 0.12.x, or 0.13.x, basically anything before the io merge and jump from 0.13 => 4.0) with a version of gulp-sass pre-2.0.2, you'll hit this problem.

To determine which version of node you're running, run node -v. To determine which version of gulp-sass is running in your project, you can simply look in package.json to see which version is defined there or run npm list | grep gulp-sass from within Assets/src.

If you're in a mismatch situation, there are two solutions, both valid depending on the situation:

If you choose to update gulp-sass on an older project, you'll almost certainly also begin to see console errors on subsequent Sass builds, relating to #193 and the now stricter syntax updates to LibSass. Looking at Phoenix 2.2.4 commits should help alleviate those.