node js 报错的 atob base64编码问题

stephen2017
  • 10
@airdge sudo npm install btoa-atob 
bin@1.0.0 /usr/bin 
└── btoa-atob@0.1.2 

node code.js
/home/shenjianlin/code.js:47
return JSON.parse(a("5e5062e82f15fe4ca9d24bc561080e0e",atob(t),0,0,"012345677890123",1))
                                                       ^

ReferenceError: atob is not defined
    at n (/home/shenjianlin/code.js:47:56)
    at Object.<anonymous> (/home/shenjianlin/code.js:54:13)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:160:9)
为啥我安装了还是报错呢?

回复
阅读 3.5k
2 个回答

安装也得require吧

你知道吗?

宣传栏