# Adding vendor JS to manifest.json not working

**URL:** https://discourse.roots.io/t/adding-vendor-js-to-manifest-json-not-working/6926
**Category:** sage
**Tags:** gulp
**Created:** 2016-06-09T10:53:44Z
**Posts:** 8

## Post 1 by @yaharga — 2016-06-09T10:53:44Z

I added a vendor plugin to manifest.json but it keeps giving me an error.

Here’s my manifest.json file:

```
{
  "dependencies": {
    "main.js": {
      "files": [
        "scripts/main.js"
      ],
      "vendor": [
        "scripts/vendor/paperfold.js" //This is my vendor plugin
      ],
      "main": true
    },
    "main.css": {
      "files": [
        "styles/main.scss"
      ],
      "main": true
    },
    "customizer.js": {
      "files": [
        "scripts/customizer.js"
      ]
    },
    "jquery.js": {
      "bower": [
        "jquery"
      ]
    }
  },
  "config": {
    "devUrl": "http://yaharga/"
  }
}
```

It gives me the following error:

```
stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error
    at new JS_Parse_Error (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:1526:18)
    at js_error (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:1534:11)
    at croak (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2026:9)
    at token_error (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2034:9)
    at unexpected (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2040:9)
    at expr_atom (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2554:9)
    at maybe_unary (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2716:19)
    at expr_ops (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2751:24)
    at maybe_conditional (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2756:20)
    at maybe_assign (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2780:20)
```

---

## Post 2 by @yaharga — 2016-06-09T11:04:02Z

Check your js files everyone! Apparently I downloaded the html page instead of the js file from the github repo.

On that note, how would I install this vendor js using bower instead of manually downloading it and adding it to the folder and then manifest.json? It has no package registered on bower. Is what I did best practice, or is there a better way?

I got the package from here: [https://github.com/mrflix/paperfold](https://github.com/mrflix/paperfold)

Thanks!

---

## Post 3 by @cfx — 2016-06-09T12:16:03Z

Not “registered on bower?” [https://github.com/mrflix/paperfold/blob/master/bower.json](https://github.com/mrflix/paperfold/blob/master/bower.json)

See also:

1. [http://bower.io/#install-packages](http://bower.io/#install-packages)
2. [https://roots.io/sage/docs/theme-development-and-building/#adding-front-end-packages-with-bower](https://roots.io/sage/docs/theme-development-and-building/#adding-front-end-packages-with-bower)

---

## Post 4 by @yaharga — 2016-06-09T12:18:54Z

I tried searching for it on [http://bower.io/search/](http://bower.io/search/) but couldn’t find it using the keywords “paper” and “fold”. How would I be able to install it after I find the bower file in the repository? Thanks.

---

## Post 5 by @cfx — 2016-06-09T12:31:06Z

Please read the documentation for Bower and Sage. The links I posted above will take you _directly_ to the relevant docs.

---

## Post 6 by @yaharga — 2016-06-09T12:49:37Z

I appreciate you replying to me once again. Perhaps you misunderstood me.

I tried installing it using `bower install --save paperfold` and  
`bower install --save https://github.com/mrflix/paperfold/blob/master/bower.json` but it doesn’t work. Even `bower install --save https://github.com/mrflix/paperfold.git` won’t work. I purchased the Roots book and the Gulp and Bower screencast. What am I doing wrong?

---

## Post 7 by @cfx — 2016-06-09T13:06:51Z

> What am I doing wrong?

You’re not reading the Bower docs I linked to above :wink:

---

## Post 8 by @yaharga — 2016-06-09T13:08:21Z

> [@cfx](#):
>
> [Bower — a package manager for the web](http://bower.io/#install-packages)  
> [https://roots.io/sage/docs/theme-development-and-building/#adding-front-end-packages-with-bower](https://roots.io/sage/docs/theme-development-and-building/#adding-front-end-packages-with-bower)

I kept going back to the second one. Sorry. Thanks! Appreciate your patience.
