razorpay / ifsc

:bank: IFSC Codes Repository
https://ifsc.razorpay.com
MIT License
338 stars 129 forks source link

npm package giving error #47

Closed waqas-mehmood-pk closed 6 years ago

waqas-mehmood-pk commented 6 years ago

inside the npm package src/node/index.js file very first line requires the fs npm package but fs package not exists. can you please tell me about this require('fs').

image

captn3m0 commented 6 years ago

This is the standard node fs module: https://nodejs.org/api/fs.html#fs_file_system

captn3m0 commented 6 years ago

@whfamily2006 Can you post the error you are getting?

captn3m0 commented 6 years ago
$ node
> require('ifsc').validate('HDFC0000001')
true
waqas-mehmood-pk commented 6 years ago

Error on my side:

ERROR  Failed to compile with 1 errors11:56:49 AM

This dependency was not found:

* fs in ./~/ifsc/src/node/index.js

To install it, you can run: npm install --save fs

But I have installed fs npm package, here is my package.json dependencies:

  "dependencies": {
    "babel-plugin-transform-runtime": "^6.23.0",
    "chart.js": "^2.7.1",
    "datatables.net": "^1.10.16",
    "datatables.net-dt": "^1.10.16",
    "fs": "0.0.1-security",
    "ifsc": "^1.0.11",
    "select2": "^4.0.5",
    "vue-chartjs": "^2.8.7",
    "vue-good-table": "^1.16.0",
    "vue-search-select": "^2.4.0",
    "vue-strap": "^1.1.40",
    "vue-template-compiler": "^2.5.7",
    "vuejs-datepicker": "git+https://github.com/paaysay/vuejs-datepicker.git"
  }
captn3m0 commented 6 years ago

Please remove the fs package from your npm setup and try again. The fs module is part of node and is not required to be installed.

The package seems to be all fine: https://runkit.com/embed/hyy84qcdmjkl

waqas-mehmood-pk commented 6 years ago

Thanks @captn3m0 Even I install fs package or remove from my package.json, in both cases error occurred.

image

pronav commented 6 years ago

Are you using it with webpack? This package works with node.

waqas-mehmood-pk commented 6 years ago

Yes, I am using this with webpack, is it possible or not with webpack?

captn3m0 commented 6 years ago

This is a Node.JS only package as of now, since the package does offline validation over a 300kb file, which you don't want to load over a web browser.

Instead, just make a AJAX request to https://ifsc.razorpay.com/{IFSC} to validate a IFSC code for a much faster method.

yajendra commented 4 years ago

Same Error not able to find fs module even i have installed it globally on my system. Kindly assist waiting for your reply. Screen Shot 2020-04-10 at 6 32 31 PM