SilentCicero / ethereumjs-accounts

A simple module for creating, managing and using Ethereum accounts in browser.
MIT License
150 stars 58 forks source link

package.json is sourcing browsify version to nodemoduels #8

Open pasupulaphani opened 9 years ago

pasupulaphani commented 9 years ago

Hey guys, here is the problem.

$ node server.js
/Users/phani/new_work/test/webogram/node_modules/ethereumjs-accounts/node_modules/localstorejs/index.js:127
            var value = localStorage.getItem(key),
                        ^
ReferenceError: localStorage is not defined
    at Object.module.exports.get (/Users/phani/new_work/test/webogram/node_modules/ethereumjs-accounts/node_modules/localstorejs/index.js:127:16)
    at new module.exports (/Users/phani/new_work/test/webogram/node_modules/ethereumjs-accounts/index.js:78:31)
    at Object.<anonymous> (/Users/phani/new_work/test/webogram/server.js:255:16)

Kind regards, Phani.

SilentCicero commented 9 years ago

So js-accounts should be used for in-browser use only. Using it with node will cause errors as localStorage is a browser storage method, not a node storage method. There may be a way to design around this. Apologies for the late reply.