Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expo install rnmapbox/maps NOT FOUND #1831

Closed
ErikJungh opened this issue Apr 12, 2022 · 8 comments · Fixed by #1832
Closed

expo install rnmapbox/maps NOT FOUND #1831

ErikJungh opened this issue Apr 12, 2022 · 8 comments · Fixed by #1832

Comments

@ErikJungh
Copy link

ErikJungh commented Apr 12, 2022

Describe the bug
A clear and concise description of what the bug is.
Installing rnmapbox/maps results in an error even for completely new/fresh expo project.

To Reproduce
Steps to reproduce the behavior.

  1. create a new folder
  2. run: expo init
  3. follow instructions to set up a blank managed workflow
  4. cd {projectname}
  5. npm install mapbox-gl
  6. "mapbox-gl": "^2.8.0", is added to package.json
  7. run expo install rnmapbox/maps OR expo install rnmapbox/maps#main OR npm install rnmapbox/maps
  8. "undefined": "rnmapbox/maps" is added to package.json
  9. Error presents itself

Please include a single standalone React Native component.
Use our BugReportTemplate screens as a starting point.
Please simplify the example as much as possible!

If it's a build/startup issue please include full steps to reproduce from react-native init ...

Example:

expo init 
cd {projectname}
npm install mapbox-gl
expo install  rnmapbox/maps OR expo install  rnmapbox/maps#main OR npm install rnmapbox/maps

Expected behavior
A clear and concise description of what you expected to happen.
I expected rnmapbox to install and then by following the following guide be able to run rnmapbox in my expo app outside of the expo go app.
https://github.com/rnmapbox/maps/blob/main/plugin/install.md

Installing for example @expo/vector-icons works fine.

Actual behavior
A clear and concise description of what is currently happening.

The command fails with error msg:
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@rnmapbox%2fmaps - Not found
npm ERR! 404
npm ERR! 404 '@rnmapbox/maps@*' is not in this registry.

and
"undefined": "rnmapbox/maps"
is added to package.json

Versions (please complete the following information):

  • Platform: [e.g. Android, iOS] iOS
  • Platform OS: [e.g. Android 9, iOS 10] 15.3.1
  • Device: [e.g. iPhone6] iphone 11
  • Emulator/ Simulator: [yes/ no] same for both
  • Dev OS: [e.g. OSX 11.0.1, Win10] MacOS Monterey 12.0.1 running m1 silicone
  • @rnmapbox/maps Version [e.g. 10.0.1] tried 8.0.0 and latest
  • Mapbox GL version [e.g. 6.3.0] 2.8.0
  • React Native Version [e.g. 0.59] 0.64.3

Additional context
Add any other context about the problem here.

The package had a namechange from react-native-mapbox-gl to rnmapbox in this commit 27 days ago:

90379a9

@mfazekas
Copy link
Contributor

Have you tried expo install rnmapbox/maps#main?! It's not yet published to npm so you'll need to add from #main branch for now.

@ErikJungh
Copy link
Author

ErikJungh commented Apr 12, 2022

yes I should have mentioned this. The above command gives the same error and adds: "undefined": "rnmapbox/maps#main" to package.json. @mfazekas

@mfazekas
Copy link
Contributor

% expo --version
5.3.0
%  expo init rntest -t blank
% cd rntest
% expo install rnmapbox/maps#main
% cat package.json | grep mapbox
    "@rnmapbox/maps": "rnmapbox/maps#main",

@ErikJungh
Copy link
Author

ErikJungh commented Apr 12, 2022

Apologise for the text wall @mfazekas but I can't seem to figure this out.

I’ve done

% expo --version
5.3.1 (Gave v5.3.0 a try as well without success)
% node -v
v16.14.2
%npm -v
8.6.0
%  expo init rntest -t blank
% cd rntest
% expo install rnmapbox/maps#main

npm ERR! code 127
npm ERR! git dep preparation failed
npm ERR! command /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/erikjungh/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > @rnmapbox/maps@10.0.0-beta.1 prepare
npm ERR! > yarn build:plugin
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN ERESOLVE overriding peer dependency
npm ERR! npm WARN While resolving: use-subscription@1.6.0
npm ERR! npm WARN Found: react@17.0.2
npm ERR! npm WARN node_modules/react
npm ERR! npm WARN dev react@"17.0.2" from the root project
npm ERR! npm WARN 9 more (@testing-library/react-native, react-native, ...)
npm ERR! npm WARN
npm ERR! npm WARN Could not resolve dependency:
npm ERR! npm WARN peer react@"^18.0.0" from use-subscription@1.6.0
npm ERR! npm WARN node_modules/use-subscription
npm ERR! npm WARN use-subscription@"^1.0.0" from react-native@0.67.0
npm ERR! npm WARN node_modules/react-native
npm ERR! npm WARN
npm ERR! npm WARN Conflicting peer dependency: react@18.0.0
npm ERR! npm WARN node_modules/react
npm ERR! npm WARN peer react@"^18.0.0" from use-subscription@1.6.0
npm ERR! npm WARN node_modules/use-subscription
npm ERR! npm WARN use-subscription@"^1.0.0" from react-native@0.67.0
npm ERR! npm WARN node_modules/react-native

npm ERR! sh: yarn: command not found
npm ERR! npm ERR! code 127
npm ERR! npm ERR! path /Users/erikjungh/.npm/_cacache/tmp/git-cloneXZssEp
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c yarn build:plugin

npm exited with non-zero code: 127
Error: npm exited with non-zero code: 127
at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (node:events:510:26)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
...
at Object.spawnAsync [as default] (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
at NpmPackageManager._runAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:175:31)
at NpmPackageManager.installAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:91:16)
at NpmPackageManager.addWithParametersAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:105:18)
at actionAsync (/usr/local/lib/node_modules/expo-cli/src/commands/installAsync.ts:141:3)

I’ve tried the following
Tried (with no effect):

$ npm cache clean --force
$ rm -rf node_modules
% delete package-lock.json
npm install -g npm@8.6.0
$ npm install
$ npm start

@mfazekas
Copy link
Contributor

you don't seems to have yarn installed and for now expo requires yarn because of the prepare script.

npm ERR! sh: yarn: command not found

mfazekas added a commit that referenced this issue Apr 12, 2022
mfazekas added a commit that referenced this issue Apr 12, 2022
@ErikJungh
Copy link
Author

ErikJungh commented Apr 12, 2022

Thanks! this solved the issue and the package was added to my node modules without errors. Although adding the plugin to my app.json and running ios build command results in:

cd ios
pod update
cd ..
expo run:ios

Failed to resolve plugin for module "@rnmapbox/maps" relative to "{path to repo}"

my package.json still keeps adding it as {"undefined": "rnmapbox/maps#main"} although expo install command succeeds.

@KiwiKilian
Copy link
Collaborator

@ErikJungh the package is phasing over to a new npm package name, which is not yet deployed which might be a reason, why npm can't resolve it. So you can just edit your dependencies in the package.json to look like this:

"@rnmapbox/maps": "github:rnmapbox/maps#main",

And run npm install afterwards. For me it works with eas build, but I haven't tested expo run:ios.

@ErikJungh
Copy link
Author

Just got it running with expo run:ios aswell. If anyone comes across this and gets any issues with various "Module Mapbox not found" I solved it by adding this:

% $RNMapboxMaps.post_install(installer)

in the post install section of the podfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants