conveyal / ModeifyReactNative

react-native app for Modeify
MIT License
5 stars 0 forks source link

Unable to resolve module react-navigation/src/views/HeaderBackButton #2

Closed ravi-ramadoss closed 6 years ago

ravi-ramadoss commented 6 years ago

Thanks for publishing license. I'm trying to install the project and I get the error.

Transforming modules  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░  99.0% (1029/1034)...(node:57701) UnhandledPromiseRejectionWarning: UnableToResolveError: Unable to resolve module react-navigation/src/views/HeaderBackButton from /Users/raviramadoss/gitprojects/modeify-react-native-v2/js/components/header.js: Module does not exist in the module map or in these directories:
  /Users/raviramadoss/gitprojects/modeify-react-native-v2/node_modules/react-navigation/src/views

I have given the steps I tried below.

mkdir ~/Downloads/delaware_r5
cd ~/Downloads/delaware_r5
curl http://download.geofabrik.de/north-america/us/delaware-latest.osm.pbf -o delaware-latest.osm.pbf
curl -LO http://dartfirststate.com/information/routes/gtfs_data/dartfirststate_de_us.zip -o dartfirststate_de_us.zip

cd /Users/raviramadoss/gitprojects
git clone  https://github.com/conveyal/r5.git r5-3.2.0
cd r5-3.2.0
git checkout tags/v3.4.1
mvn package -DskipTests
java -Xmx1G -cp target/v3.4.1.jar com.conveyal.r5.R5Main point --build /Users/raviramadoss/Downloads/delaware_r5
java -Xmx1G -cp target/v3.4.1.jar com.conveyal.r5.R5Main point --graphs /Users/raviramadoss/Downloads/delaware_r5

curl 'http://localhost:8080/otp/routers/default/index/graphql' -H 'Accept-Encoding: gzip, deflate' -H 'Content-Type: application/json; charset=UTF-8' --data-binary '{"query":"query requestPlan($fromLat:Float!, $fromLon:Float!,\n $toLat:Float!, $toLon:Float!, $wheelchair:Boolean\n $fromTime: ZonedDateTime!, $toTime:ZonedDateTime!,\n $bikeTrafficStress:Int!, $minBikeTime:Int!\n ) {\nplan(fromLat:$fromLat, fromLon:$fromLon, toLat:$toLat,toLon:$toLon, wheelchair:$wheelchair, fromTime:$fromTime, toTime:$toTime, \n \n directModes:[WALK,BICYCLE,CAR],\n accessModes:[WALK,BICYCLE,CAR_PARK], egressModes:[WALK],\ntransitModes:[BUS],\nbikeTrafficStress: $bikeTrafficStress, minBikeTime: $minBikeTime) {\n patterns {\n tripPatternIdx\n trips {\n tripId\n serviceId\n wheelchairAccessible\n bikesAllowed\n }\n }\n options {\n summary,\n fares {\n type,low,peak,senior, transferReduction, currency\n }\n itinerary {\n waitingTime\n walkTime\n distance\n transfers\n duration\n transitTime\n startTime\n endTime,\n connection {\n access\n egress,\n transit {\n pattern\n time\n }\n }\n \n }\n \n \n transit {\n from {\n name,\n stopId,\n lon,\n lat,\n wheelchairBoarding\n },\n to {\n name,\n stopId,\n lon,\n lat,\n wheelchairBoarding\n },\n mode,\n routes {id, routeIdx shortName, mode, agencyName},\n segmentPatterns {\n patternId, patternIdx,\n\trouteIdx\n fromIndex\n toIndex,\n fromDepartureTime\n toArrivalTime,\n tripId\n \n \n },\n middle {\n mode,\n duration,\n distance,\n geometryGeoJSON,\n }\n },\n \n access {\n mode,\n duration,\n distance,\n #geometryGeoJSON,\n \n #elevation {\n #distance\n #elevation\n #},\n #alerts {\n #alertHeaderText\n #alertDescriptionText\n #alertUrl\n #effectiveStartDate\n #effectiveEndDate\n #},\n streetEdges {\n #edgeId\n distance\n geometryGeoJSON\n mode\n streetName\n relativeDirection\n absoluteDirection\n #stayOn\n #area\n #exit\n #bogusName,\n bikeRentalOnStation {\n id,\n name,\n lat,lon\n }\n bikeRentalOffStation {\n id,\n name,\n lat,lon\n }\n parkRide {\n id,\n name,\n lat,lon\n }\n }\n },\n egress {\n mode,\n duration,\n distance,\n geometryGeoJSON,\n \n #elevation {\n #distance\n #elevation\n #},\n #alerts {\n #alertHeaderText\n #alertDescriptionText\n #alertUrl\n #effectiveStartDate\n #effectiveEndDate\n #},\n streetEdges {\n #edgeId\n #distance\n #geometryPolyline\n mode\n geometryGeoJSON,\n streetName\n relativeDirection\n absoluteDirection\n #stayOn\n #area\n #exit\n #bogusName,\n #bikeRentalOnStation {\n #id,\n #name,\n #lon,lat\n #}\n }\n }\n } \n }\n \n #patterns{patternId, startTime, endTime, realTime, arrivalDelay, departureDelay}\n} \n","variables":"{\"fromLat\":\"39.828905\",\"fromLon\":\"-75.538053\",\"toLat\":\"39.806424\",\"toLon\":\"-75.552387\",\"wheelchair\":false,\"fromTime\":\"2018-04-23T07:00-04:00\",\"toTime\":\"2018-04-23T09:00-04:00\",\"minBikeTime\":5,\"bikeTrafficStress\":4}"}' --compressed

#results output ok.

git clone https://github.com/conveyal/modeify.git modeify-v1.3.0
cd modeify-v1.3.0
git checkout tags/v1.3.0

#upgrade node to 8, because I have 8 and 6 is ending life
sed -i .bak 's/\"node\": \"6\"/\"node\": \"8\"/' package.json
sed -i .bak 's/\"npm\": \"3\"/\"npm\": \"5\"/' package.json

#upgrade mastarm to 4.1.0
sed -i .bak 's/\"mastarm\": \"\^3.7.1\"/\"mastarm\": \"\^4.1.0\"/' package.json

npm install

#replace configprations/default/settings.yml with https://gist.github.com/ravi9884/20dba9d9d5792f96ae414499d2a6e717

#replace configprations/default/env.yml https://gist.github.com/ravi9884/dd1dceba8832536dcc6726300934aa64

#open http://localhost:5000/planner

git clone https://github.com/conveyal/ModeifyReactNative.git modeify-react-native-v2
cd modeify-react-native-v2
#create config.json from https://gist.github.com/ravi9884/e001aced090acb90f2997b606ab3ea00

npm install
npm start

#error
  Transforming modules  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░  99.0% (1029/1034)...(node:57701) UnhandledPromiseRejectionWarning: UnableToResolveError: Unable to resolve module react-navigation/src/views/HeaderBackButton from /Users/raviramadoss/gitprojects/modeify-react-native-v2/js/components/header.js: Module does not exist in the module map or in these directories:
  /Users/raviramadoss/gitprojects/modeify-react-native-v2/node_modules/react-navigation/src/views

#Try with a lower commit
 git checkout 33d6016cdad61fd73b64084279eb5fad6c46615e

#Same error
ravi-ramadoss commented 6 years ago

I was able to solve the issue by running yarn install instead of npm install