Dav
Dav

Reputation: 33

My local server can't find bower files when I run my application

i have to run an application from a local repo (called exoplanet-explorer). I installed Node.js and Git, and I followed these steps:

in the command line of Git Bash:

  git clone https://github.com/udacity/exoplanet.explorer.git
  cd exoplanet-explorer
  npm install -g gulp bower
  npm install && bower install
  gulp serve

When I run gulp serve, the app page opens but it's blank. In the console this list of errors appears:

Failed to load resource: the server responded with a status of 404 (Not Found) webcomponents-lite.js:1 

(index):1 Refused to execute script from 'http://localhost:5000/bower_components/webcomponentsjs/webcomponents-lite.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

:5000/bower_components/iron-flex-layout/classes/iron-flex-layout.html:1 Failed to load resource: the server responded with a status of 404 (Not Found)   

:5000/bower_components/iron-pages/iron-pages.html:1 Failed to load resource: the server responded with a status of 404 (Not Found)

:5000/bower_components/iron-selector/iron-selector.html:1 Failed to load resource: the server responded with a status of 404 (Not Found)

:5000/bower_components/paper-material/paper-material.html:1 Failed to load resource: the server responded with a status of 404 (Not Found)

:5000/bower_components/paper-menu/paper-menu.html:1 Failed to load resource: the server responded with a status of 404 (Not Found)

:5000/bower_components/paper-scroll-header-panel/paper-scroll-header-panel.html:1 Failed to load resource: the server responded with a status of 404 (Not Found)

:5000/bower_components/paper-styles/paper-styles-classes.html:1 Failed to load resource: the server responded with a status of 404 (Not Found)

:5000/bower_components/paper-toolbar/paper-toolbar.html:1 Failed to load resource: the server responded with a status of 404 (Not Found)

[Deprecation] Styling master document from stylesheets defined in HTML Imports is deprecated, and is planned to be removed in M67, around May 2018. Please refer to  for possible migration paths.

page.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)

(index):1 Refused to execute script from 

'http://localhost:5000/bower_components/page/page.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

:5000/bower_components/polymer/polymer.html:1 Failed to load resource: the server responded with a status of 404 (Not Found)

planet-thumb.html:78 Uncaught ReferenceError: Polymer is not defined
at planet-thumb.html:78
at planet-thumb.html:100

scale-visualizer.html:68 Uncaught ReferenceError: Polymer is not defined
at scale-visualizer.html:68
at scale-visualizer.html:189

What can I do?

Upvotes: 1

Views: 1091

Answers (1)

Tony
Tony

Reputation: 104

I am working on the same project and I had the exact same issues, using Windows 10 Home, git version 2.15.1.windows.2 and node v8.11.3, npm v6.1.0, bower v1.8.4, gulp v3.9.1. I looked to where the bower_components folder is supposed to be located and there is absolutely nothing there. I also opened bash as administrator to install.

If you are having these errors, bower is NOT installing the polymer-starter-kit properly for whatever reason or you forgot/failed to install it yourself. I actually watched my installs fail, as over and over i would install, type "bower list" and it would tell me the polymer files in the starter kit that I needed, were still not installed - but I just saw the files install.

So I had to do a "bower install -f polymer-starter-kit" after i did this and then installed gulp and typed gulp serve everything worked perfectly. Hope this helps someone else - I just spent over 16 hours yesterday and 5 today trying to figure this out. NOTE: you might want to do a "bower cache clean" first.

Upvotes: 1

Related Questions