我刚刚开始学习Nodejs。
我正在学习持久模块。这是我的代码:
var storage = require('node-persist');
// console.log(storage);
storage.initSync();
但是我遇到了这个错误
TypeError: storage.initSync is not a function
而console.log存储时,只有create和init
{ create: [Function], init: [Function] }
我的代码有什么地方错误吗?
最佳答案
您应该检查 3.0.0 更改日志
All the *Sync functions were removed, every operation is now asynchronous
关于node.js - Node 持久化 : initSync is not a function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53929277/