我正试图将localfeed安装到node.js应用程序(带angular)中并浏览。
Here is a link to the localForage documentation
似乎使用localfood和angular localfood会导致基于使用'require'的browserify出现问题
如果需要localforage.js文件中的src文件,则会出现以下错误:

Warning: module "promise" not found from "/Users/mgayhart/Sites/epson-    receipts/bower_components/localforage/src/localforage.js" Use --force to continue.

如果需要localforage.js文件中的dist文件,则会出现以下错误:
Warning: module "./drivers/indexeddb" not found from "/Users/mgayhart/Sites/epson-  receipts/bower_components/localforage/dist/localforage.js" Use --force to continue.

有人知道如何解决这些库的问题吗?

最佳答案

我把它安装在凉亭里,然后用棕色的垫片。所以在package.json中:

"browser": {
   "localforage":"./src/lib/vendor/localforage/dist/localforage.min.js"
},

"browserify-shim": {
   "localforage":"localforage"
}

并将其公开为角服务(如果您不想使用angular-localforage):
app.factory "localforage",-> require 'localforage'

09-16 21:54