0

我使用了来自 google viz 的几个库。

  1. 谷歌地图
  2. 谷歌选择器
  3. 用于身份验证的 google 客户端 api

我想使用以下方法填充L.Googlebrowserify-shim

"browserify-shim": {
"google": "global:google",
"L.Google": {
  "depends": [
    "leaflet:L",
    "google"
  ]
}
...
}

我收到此错误:

 Error: Cannot find module 'google' from 'C:\Users\lenovo\Downloads\Browserify\Br
owserify\js\leaflet-plugins'
    at C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node_modules\
resolve\lib\async.js:46:17
    at process (C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node
_modules\resolve\lib\async.js:173:43)
    at ondir (C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node_m
odules\resolve\lib\async.js:188:17)
    at load (C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node_mo
dules\resolve\lib\async.js:69:43)
    at onex (C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node_mo
dules\resolve\lib\async.js:92:31)
    at C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node_modules\
resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:95:15)
4

0 回答 0