terrylinla / react-native-sketch-canvas

A React Native component for drawing by touching on both iOS and Android.
MIT License
691 stars 450 forks source link

Expo build #237

Closed runchevski closed 1 year ago

runchevski commented 1 year ago

Expo build fails with the follwing error: image

I tried the fix in issue #234 but without any luck since the build is not being done locally and seems like Expo is ignoring the postinstall in the package.json, has anyone found any workaround for this?

Note: I tried taking the repo outside of the node_modules, replacing line 31 from provided to implementation and putting it in the parent directory, linking it in the package.json as local repo dependency, the build succeeds but the app crashes on start.

"dependencies": {
   ...
   "@terrylinla/react-native-sketch-canvas": "file:@terrylinla/react-native-sketch-canvas-master/package.json",
   ...
}

and

"scripts": {
   ...
   "preinstall": "npm install ./@terrylinla/react-native-sketch-canvas-master",
   ...
}
runchevski commented 1 year ago

after a lot of digging I found a fix, if you are using npm ^10.24.1 the nodel_module inside the package.json should be referenced as:

"dependencies": {
   ...
   "@terrylinla/react-native-sketch-canvas": "file:./@terrylinla/react-native-sketch-canvas-master/package.json",
   ...
}

otherwise you just point to the folder without pointing to the package.json file:

"dependencies": {
   ...
   "@terrylinla/react-native-sketch-canvas": "file:./@terrylinla/react-native-sketch-canvas-master",
   ...
}

hope this helps!