designer icon indicating copy to clipboard operation
designer copied to clipboard

build.sh does not work in Windows

Open justinfagnani opened this issue 9 years ago • 46 comments

justinfagnani avatar Apr 01 '15 21:04 justinfagnani

Tried setting this up. Started with:

  1. bower install
  2. npm install
  3. npm run-script build (produces error): debug

Noticed I didn't have browserify installed so I installed with: npm install browserify -g

Running: npm run-script build still didn't work. Notice the error: '.' is not recognized as an internal or external command...... So I edited the package.json file. Here's a shot of the edited file which worked: debug2

Now I could run: npm run-script build successfully after which i run npm start: debug3

However nothing loads at localhost:8080. And its running on Chrome Canary. Console error attached: debug4

Can't seem to figure out the problem.

jlinco avatar Apr 15 '15 14:04 jlinco

See https://github.com/Polymer/designer/issues/100#issuecomment-88652515 for a workaround for the redirect issue on windows.

IntranetFactory avatar Apr 15 '15 14:04 IntranetFactory

The link https://github.com/PolymerLabs/polyserve/blob/master/src/server.js#L42 doesn't exist.

Also the code you reference seems to have been replaced:

var splitPath = url.pathname.split(path.sep).slice(1);

jlinco avatar Apr 15 '15 15:04 jlinco

It seems to be now in line https://github.com/PolymerLabs/polyserve/blob/master/src/make_app.js#L37 - which was not changed. On Windows path.sep == "" - so I think the corrected line should be

var splitPath = url.pathname.split("/").slice(1);

IntranetFactory avatar Apr 15 '15 15:04 IntranetFactory

Hmmm, this is strange. I changed the line like you suggested. Still didn't work. Also noticed this line https://github.com/PolymerLabs/polyserve/blob/master/src/make_app.js#L41 which i changed to var filePath = splitPath.join("/"); Still no joy. Wondering what could be wrong...

jlinco avatar Apr 15 '15 17:04 jlinco

I have same problem as original post....

MartinOrtiz avatar Apr 27 '15 18:04 MartinOrtiz

I'll get the changes that should fix Windows in soon, and I'm also setting up a Windows VM to test the build/install process.

justinfagnani avatar Apr 28 '15 19:04 justinfagnani

Just a note on my issue/setup....

I am on Windows 8.1 (clean install) used GIT from here (MUST use command line option): http://git-scm.com/download/win used NodeJS from here: https://nodejs.org/ installed browserify : npm install browserify -g

I think a lot of people are cloning/using main branch (like I did) which is a mistake! The active branch they really want is "designer2" To do that you MUST do it this way! git clone -b designer2 https://github.com/Polymer/designer.git (please confirm this)

in package.json, line #12 must be modified from "build": "./build.sh" to this "build": "build.sh"

I then did npm start inside the main polmer folder... Note that it serves components out of "bower_components" Which is fine except the html inside that folder uses "components" folder. I also noticed the html for polymer components referencing folders that were NOT in the correct locations. So the folder referencing and or folder locations were all messed up.

MartinOrtiz avatar Apr 28 '15 21:04 MartinOrtiz

The designer2 branch isn't necessary, it was just old, so I deleted it. The polyserve fix for path separators has been in, so things should work now. I still don't have the VM setup, so reports of success or failure are greatly appreciated! :)

justinfagnani avatar May 01 '15 20:05 justinfagnani

bower install prompted for a lot of conflicts - maybe I selected the wrong version for a component:

  "resolutions": {
    "iron-flex-layout": "master",
    "iron-iconset-svg": "master",
    "iron-selector": "master",
    "paper-ripple": "master",
    "polymer": "v0.8.0-rc.7",
    "webcomponentsjs": "master"
  }

I get now the following error

2015-05-01_1807

IntranetFactory avatar May 01 '15 22:05 IntranetFactory

I think you need to npm update && npm run-script build

justinfagnani avatar May 01 '15 22:05 justinfagnani

I think I did that (npm run-script build still fails) so I executed the command one by one.

polymer-designer-demos doesn't exist in my bower_components folder. If I create that folder the error messages are not showing any longer, but I'm not sure if the resulting page is correct. Can't seem to find a way to create/edit a component:

2015-05-01_1830

IntranetFactory avatar May 01 '15 22:05 IntranetFactory

Ahh... I need to add another step to the instructions, which is to run bower install in the demo directory

justinfagnani avatar May 01 '15 22:05 justinfagnani

Done - but the designer looks unchanged (like above)

That's the contents of my demo directory: 2015-05-01_1834

IntranetFactory avatar May 01 '15 22:05 IntranetFactory

There's no file list in the nav drawer? Are you still getting 404's in the console?

justinfagnani avatar May 01 '15 22:05 justinfagnani

After stopping and starting again npm start the designer looks a little different, but still can't figure out how to use it: 2015-05-01_1838

IntranetFactory avatar May 01 '15 22:05 IntranetFactory

After I have created an empty \bower_components\polymer-designer-demos the errors in the console are gone. Should there be an content in polymer-designer-demos?

bower install in the demo directory created a demo\bower_components folder in demo, but did not create \bower_components\polymer-designer-demos

When clicking on the folder icon I get 2015-05-01_1841

IntranetFactory avatar May 01 '15 22:05 IntranetFactory

Did you click the expander? There should be 7 or so demos in there.

justinfagnani avatar May 01 '15 23:05 justinfagnani

"bower install prompted for a lot of conflicts - maybe I selected the wrong version for a component:"

I also got this problem, where as before I didn't.

MartinOrtiz avatar May 01 '15 23:05 MartinOrtiz

I clicked it - but I've created the polymer-designer-demos folder, as it was missing. So it's currently empty. In which repo do I find the content for that folder?

IntranetFactory avatar May 01 '15 23:05 IntranetFactory

You don't need to create a polymer-designer-demos folder. That's served up to the browser by polyserve. Are you sure you have the latest polyserve (0.4.0)?

justinfagnani avatar May 01 '15 23:05 justinfagnani

How do I check the version? That's what I see when I start it

$ npm start

> [email protected] start c:\dev\designer2
> node server.js

Starting Polymer Designer Server on port 8080

IntranetFactory avatar May 02 '15 00:05 IntranetFactory

\node_modules\polyserve\package.json shows version 0.4.0, so I assume I have that latest version

IntranetFactory avatar May 02 '15 00:05 IntranetFactory

what about when you ls demo?

justinfagnani avatar May 02 '15 00:05 justinfagnani

Pls see above - I've already provided a screenshot.

IntranetFactory avatar May 02 '15 00:05 IntranetFactory

If I copy the *.html files from demo to bower_components\polymer-designer-demos the they are served.

IntranetFactory avatar May 02 '15 00:05 IntranetFactory

that shouldn't be necessary

justinfagnani avatar May 02 '15 00:05 justinfagnani

which bower_components/? designer/bower_components/ or designer/demo/bower_components/

justinfagnani avatar May 02 '15 00:05 justinfagnani

The files are delivered from designer\bower_components\polymer-designer-demos

IntranetFactory avatar May 02 '15 00:05 IntranetFactory

@MartinOrtiz the conflicts are somewhat expected for now, elements are shifting around a lot. I'll try to get it sorted soon, but it shouldn't matter much.

justinfagnani avatar May 02 '15 00:05 justinfagnani