Maxim Velichkin Maxim Velichkin - 11 months ago 50
Javascript Question

I don't see the "node_modules/bin" folder after installing browserify

I'm trying to repeat this tutorial:

But after installing browserify I don't see folder:


Instead I see a folder
. Inside there is a
folder, and Iinside of it -

How should I change this line of code in my case:
./node_modules/.bin/browserify app.js -o app.bundle.js
to compile all js files into one file?
Or maybe I need to install browserify some other way?

Answer Source

Put together, the flow of creating a very simple web application with these tools might look something like this:

You simply need to point your cmd prompt to the browserify node_module, so drop the .bin if it's not there => /node_modules/browserify yourjsfile.js myjsfile.bundle.js

As far as I can understand this guide: the app.js file or yourjsfile.js needs to have all the library requirements included in order for it to work.

var squareNumbers = require('./square-numbers');

This means you need to write this file as an entry point for all your scripts you need to bundle.

TIP: try to find a youtube video or something to get a better understanding of this guide.

The dot in front of these directories tells you it's a system folder, in this case, not of your operating system, but from another "system/application", like node. It puts these kind of folders alphabetically on top to make a distinction.