Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows installation/setup fails #17

Open
9 tasks done
matthewtoast opened this issue Jun 18, 2015 · 22 comments
Open
9 tasks done

Windows installation/setup fails #17

matthewtoast opened this issue Jun 18, 2015 · 22 comments

Comments

@matthewtoast
Copy link
Contributor

Installing the framework via the Famous CLI (framework branch) on a Windows machine doesn't work. Two overarching issues at play:

  • In several places in the code, file/folder paths are not constructed in a platform-agnostic way
  • At least one of the npm packages aren't compatible out-of-the-box with Windows

Here are some specific issues I've collected that will need to be resolved for Windows install to work:

  • In the project scaffolding, the build npm script should be changed to not use mkdir -p
  • The npm scripts in both the scaffolding and the framework codebase should not use $PWD
  • The npm scripts should not be cd-ing around
  • We need to refactor the scaffold and framework npm scripts to use "bin" scripts properly
  • The framework has a couple of pathing helper functions that need to be refactored to differentiate between URL paths and filesystem paths (and use Path.sep for the filesystem ones)
  • In the framework build step for dependency loading, the script is looking in the wrong paths e.g. err Could not find entrypoint file for famous\core\node; this needs to be fixed
  • Folders are created with artifacts that aren't valid on Windows, e.g. the 'public/v1/blocks' folder. The folders within use the naming convention e.g. "famous/core/node" which contain illegal characters ('/') for files/folders on Windows machines.
  • Install on Windows fails due to Python not being installed by default on Windows machines. (Windows 7 and 8?) This isn't listed anywhere as a dependency in the documentation, so the user is left reading the error message from npm indicating Python can't be found. Additionally, after installing Python, the user must set a global variable set PYTHON=C:\path\to\python27\python.exe before attempting the install again. Additionally additionally, it seems Python 3.x is not supported; the user must install Python 2.x.
  • JSDom 3.x depends on Contextify which has known issues with Windows install. Might be able to fix by upgrading to JSDom 4.x, but the last time I checked JSDom 4.x did not run on Node.js (it's only io.js compatible).
@talves
Copy link

talves commented Jun 18, 2015

@matthewtoast 👍

  • Most Windows users that use node will have Python setup correctly, but good point on the 2.x version
  • Contextify will require a C++ build on npm install that requires VCBuild.exe (needs to have Visual Studio Express installed which is huge), but worked after the install.

@matthewtoast
Copy link
Contributor Author

cc @justincsmith

@matthewtoast
Copy link
Contributor Author

I've made some initial changes toward resolving this (still more to do, though):

@matthewtoast
Copy link
Contributor Author

For the npm / installation-related issues, I'm looking at three approaches:

  1. Keep things the same (JSDom 3.x which requires Contextify), and make it a prerequisite for Windows developers to have Python 2.x and Visual Studio Express installed.
  2. Upgrade to JSDom 4.x, and make it a prerequisite that all developers to use io.js (as opposed to Node.js, which JSDom 4.x is incompatible with) until the Node.js/io.js merge is complete and/or JSDom 4.x supports both.
  3. Use a different module than JSDom entirely (Cheerio? PhantomJS? An HTML parser instead of a DOM API module?), sidestepping the issue. (We are currently using JSDom in our build step for processing components' trees.)

@talves
Copy link

talves commented Jun 18, 2015

@matthewtoast for what it is worth, here is my opinion.

I think windows developers will be more apt to accept the option 1 above rather than option 2, because there are so many other solutions having that requirement. They really are easy installs, although VS 2013 Express is bloated.

Option 3 sounds good, but when the merge happens it might have been for naught, because the Option one would go away if JSDom 4.x supports both.

@talves
Copy link

talves commented Jun 28, 2015

I just tried the framework again on Win7 and I now get no errors on install and scaffold. I have to run npm run bundle & npm run local-only-bootstrap in separate shells (no errors), but it the server does not seem to be starting.

Is windows still not supported?

@matthewtoast
Copy link
Contributor Author

@talves - Tentatively, I think Windows installation/setup is working... However note I haven't updated the Famous CLI tool yet so the $ famous framework-scaffold command is still broken.

I've gone through the full setup process from a blank slate running Windows 8 in Parallels Desktop and got things working.

If you're up for it, you can try it out:

$ git clone https://github.com/Famous/framework.git
$ cd framework
$ git fetch
$ git checkout build-refactor
$ npm install
$ npm run local-only-bootstrap

When I did the above, I saw all of the build logs go by, and was then able to open localhost:1618 in IE and see our "clickable square" demo running.

Note that there are still several rendering issues with IE11 at this time.

If this seems to work for you, can you let me know? If so I'll plan on merging changes in with the CLI tool and hopefully closing out this ticket.

@talves
Copy link

talves commented Jun 28, 2015

I do not mind running it manually. It worked after a couple tries. Get an error twice then finally runs.

The first time I ran npm run local-only-bootstrap the following error happened on the emit

{ [Error: UNKNOWN, open 'C:\git\framework-test\dev\local-workspace\build\famous-tests~dispatcher~emit\famous-tests\dispatcher\emit\child\child.js']
  errno: -4094,
  code: 'UNKNOWN',
  path: 'C:\\git\\framework-test\\dev\\local-workspace\\build\\famous-tests~dispatcher~emit\\famous-tests\\dispatcher\\emit\\child\\child.js' }

I ran it again and get this error

{ [Error: UNKNOWN, open 'C:\git\framework-test\dev\local-workspace\build\famous-tests~pass-through\famous-tests\pass-through\child-component\child-component.jade']
  errno: -4094,
  code: 'UNKNOWN',
  path: 'C:\\git\\framework-test\\dev\\local-workspace\\build\\famous-tests~pass-through\\famous-tests\\pass-through\\child-component\\child-component.jade' }

The third time it runs without an error before the server starts.

@trusktr
Copy link

trusktr commented Jun 28, 2015

@talves Maybe you can just spin up a Linux distro in Virtualbox, then serve the app to a port that you can access in your Google Chrome in Windows. xD

@talves
Copy link

talves commented Jun 28, 2015

@trusktr that would kind of defeat the purpose of getting windows up and running 😄
It is working now, so no need anyway.

@timBrockman
Copy link

in case it helps.. my install went like so:

[ws v0.4.20] Attempting to compile blazing fast native extensions.
[ws v0.4.20] Native code compile failed (but the module will still work):
[ws v0.4.20] The native extensions are faster, but not required.
[ws v0.4.20] On Windows, native extensions require Visual Studio and Python.
[ws v0.4.20] On Unix, native extensions require Python, make and a C++ compiler.
[ws v0.4.20] Start npm with --ws:verbose to show compilation output (if any).
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i
nstall"
npm ERR! node v0.12.5
npm ERR! npm  v2.11.2

npm ERR! unexpected eof
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\xampp\htdocs\angular\fam-fram-test\framework\npm-debug.log

First time I ran npm run local-only-bootstrap:

{ [Error: UNKNOWN, open 'C:\xampp\htdocs\angular\fam-fram-test\framework\dev\local-workspace\build\famous-tests~opacity\
famous-tests\opacity\child\child.js']
  errno: -4094,
  code: 'UNKNOWN',
  path: 'C:\\xampp\\htdocs\\angular\\fam-fram-test\\framework\\dev\\local-workspace\\build\\famous-tests~opacity\\famous
-tests\\opacity\\child\\child.js' }

The second time it served as planned.

@migsig
Copy link

migsig commented Jun 29, 2015

Try a 'npm cache clean'

Then run 'famous develop' in the project directory.
Should run.

On Jun 28, 2015, at 2:11 PM, Tony Alves notifications@github.com wrote:

I just tried the framework again on Win7 and I now get no errors on install and scaffold. I have to run npm run bundle & npm run local-only-bootstrap in separate shells (no errors), but it the server does not seem to be starting.

Is windows still not supported?


Reply to this email directly or view it on GitHub.

@talves
Copy link

talves commented Jun 29, 2015

@migsig that was not the problem. Thanks anyway.

Just so the devs know. It works once npm run local-only-bootstrap is re-ran as @timBrockman and I have stated.

@migsig
Copy link

migsig commented Jun 29, 2015

oh well
good luck.

On Jun 29, 2015, at 12:14 PM, Tony Alves notifications@github.com wrote:

@migsig https://github.com/migsig that was not the problem. Thanks anyway.


Reply to this email directly or view it on GitHub #17 (comment).

@etinin
Copy link

etinin commented Jun 29, 2015

just tried it. first time the npm install failed (the python in my path was 3.4, not 2.7). fixing and rerunning it without deleting the node_modules folder failed.

after deleting and reinstalling, everything worked smoothly.

@FrizzaUK
Copy link

Installation worked fine (ish) - however the build (local-only-bootstrap) fails due to invalid path names. It's trying to use ':' in the path whereas that's an invalid character in Windows! Any idea what I need to change to make the bundles build to a valid path and whether anything else needs changing, such as the deployer?

@matthewtoast
Copy link
Contributor Author

@FrizzaUK - What version of famous-framework do you see in your project's package.json? If you are using < 0.12.1 then it is likely you are missing some updates that fix that issue. (The build should be creating folders with tilde-based namespaces e.g. .foo~bar~baz)

@FrizzaUK
Copy link

That could well be it! I am running 0.11.1 - I will update and see what happens. Note to self, make sure everything is up to date!

@matthewtoast
Copy link
Contributor Author

@FrizzaUK - You should also double check that the npm scripts in your package.json match the ones in this one, since some changes may have been made in there too:

https://github.com/Famous/famous-cli/blob/master/lib/framework/scaffold/templates/_package.json

@FrizzaUK
Copy link

Back in business, thanks for your help - I can now crack on with some prototypes.

@SvitlanaShepitsena
Copy link

In my case I got node-gyp rebuild error
Woof, I finally found a way for it to work:

  1. Install Python 2.x version (I installed 2.73) and add c:\python27 to you global path variables. Check with python
  2. Install Visual Studio 2015 Community edition
  3. Install windows SDK 8.1
  4. Install node-gyp globally npm i –g node-gyp (I run console as admin)
  5. Clone framework repository, npm i – you should get an error “…. you should node-gyp rebuild….”
  6. Give a command:
    node-gyp configure
  7. After configuring is done, open with Visial Studio binding.sln project in generated build folder in the root of famo.us framework directory. Open please binding.sln not cc file.
  8. After opening VS will prompt you to download missing dependencies – accept, download
  9. Return to your console in the root famo.us and node-gyp rebuild
  10. npm run dev (cross your fingers 🙏 ). Jesus, it works!

P.S. Though if you feel that web design is not only your hobby… you (rather we) need to switch to linux or apple 😺 .
Happy coding with framework.

@identy
Copy link

identy commented Oct 11, 2015

uffffff! thk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants