The way I install `web3`: `npm install -g web3`

The way I connect into `web3`:

```
Web3 = require("web3");
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

if(!web3.isConnected()){
    console.log("not connected");
    process.exit();
}

```

When I try to run `web3.toBytes()` function inside a geth-console on using node. I faced with following error:

`TypeError: toBytes is not a function`

```
> web3.toBytes(0)
TypeError: 'toBytes' is not a function
    at <anonymous>:1:1

```

The functions `web3` returns;

```
  BigNumber: function a(e,n),
  createBatch: function(),
  fromAscii: function(str),
  fromDecimal: function(value),
  fromICAP: function(icap),
  fromUtf8: function(str),
  fromWei: function(number, unit),
  isAddress: function(address),
  isChecksumAddress: function(address),
  isConnected: function(),
  padLeft: function(string, chars, sign),
  padRight: function(string, chars, sign),
  reset: function(keepIsSyncing),
  setProvider: function(provider),
  sha3: function(string, options),
  toAscii: function(hex),
  toBigNumber: function(number),
  toChecksumAddress: function(address),
  toDecimal: function(value),
  toHex: function(val),
  toUtf8: function(hex),
  toWei: function(number, unit)

```

**[Q]** How could I fix this error?

Thank you for your valuable time and help.