Skip to content

bower_components/angular/angular.js 404 (Not Found) #28

@lackovic

Description

@lackovic

I used bower-away to migrate angular-seed from bower to yarn.

The project was successfully converted to Yarn.

I found all bower components in node_modules/@bower_components.

After running the http-server with:

yarn http-server -a localhost -p 8000 -c-1 ./app

When I open http://localhost:8000/ in a browser I get the following errors:

GET http://localhost:8000/bower_components/html5-boilerplate/dist/css/normalize.css 404 (Not Found)
GET http://localhost:8000/bower_components/html5-boilerplate/dist/css/main.css 404 (Not Found)
GET http://localhost:8000/bower_components/html5-boilerplate/dist/js/vendor/modernizr-2.8.3.min.js 404 (Not Found)
GET http://localhost:8000/bower_components/angular/angular.js 404 (Not Found)
GET http://localhost:8000/bower_components/angular-route/angular-route.js 404 (Not Found)
GET http://localhost:8000/bower_components/angular/angular.js 404 (Not Found)
GET http://localhost:8000/bower_components/angular-route/angular-route.js 404 (Not Found)

Here you can see the index.html

The bower_components once resided in app/bower_components but after the migration are located in node_modules\@bower_components

It looks like when running yarn install the postinstall script tries to create a symbolic link to node_modules/@bower_components in the app directory, but silently fails: no link is created and no error message is displayed.

postinstall script:

try {
    require('fs')
        .symlinkSync(require('path')
            .resolve('node_modules/@bower_components'), 'app\\bower_components', 'junction')
} catch (e) {}

I tried running yarn add file-system but that didn't fix the issue.

Full source code of the project can be found here.

Any idea how could I make it work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions