File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -104,14 +104,23 @@ export const relocateBinaries = async (baseDir: string): Promise<void> => {
104104 return
105105 }
106106
107- const lmdbPath = findModuleFromBase ( {
107+ let lmdbPath = findModuleFromBase ( {
108108 paths : [ gatsbyPath , baseDir ] ,
109- candidates : [ 'lmdb-store' , 'lmdb' ] ,
109+ candidates : [ 'lmdb-store' ] ,
110110 } )
111111
112112 if ( ! lmdbPath ) {
113- console . log ( `Could not find lmdb module in ${ gatsbyPath } ` )
114- return
113+ const modulePath = findModuleFromBase ( {
114+ paths : [ gatsbyPath , baseDir ] ,
115+ candidates : [ 'lmdb' ] ,
116+ } )
117+ if ( modulePath ) {
118+ // The lmdb package resolves to a subdirectory of the module, and we need the root
119+ lmdbPath = dirname ( modulePath )
120+ } else {
121+ console . log ( `Could not find lmdb module in ${ gatsbyPath } ` )
122+ return
123+ }
115124 }
116125
117126 console . log (
@@ -135,6 +144,8 @@ export const relocateBinaries = async (baseDir: string): Promise<void> => {
135144 if ( existsSync ( from ) && ! existsSync ( to ) ) {
136145 console . log ( `Copying ${ from } to ${ to } ` )
137146 await copyFile ( from , to )
147+ } else {
148+ console . log ( `Skipping ${ from } ` )
138149 }
139150 }
140151}
You can’t perform that action at this time.
0 commit comments