File tree 1 file changed +15
-4
lines changed
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> => {
104
104
return
105
105
}
106
106
107
- const lmdbPath = findModuleFromBase ( {
107
+ let lmdbPath = findModuleFromBase ( {
108
108
paths : [ gatsbyPath , baseDir ] ,
109
- candidates : [ 'lmdb-store' , 'lmdb' ] ,
109
+ candidates : [ 'lmdb-store' ] ,
110
110
} )
111
111
112
112
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
+ }
115
124
}
116
125
117
126
console . log (
@@ -135,6 +144,8 @@ export const relocateBinaries = async (baseDir: string): Promise<void> => {
135
144
if ( existsSync ( from ) && ! existsSync ( to ) ) {
136
145
console . log ( `Copying ${ from } to ${ to } ` )
137
146
await copyFile ( from , to )
147
+ } else {
148
+ console . log ( `Skipping ${ from } ` )
138
149
}
139
150
}
140
151
}
You can’t perform that action at this time.
0 commit comments