React-Native Packager Failure: Duplicate module name

sudo or chown did not fix it for me. I get the same error from the same library, very odd:

Failed to build DependencyGraph: @providesModule naming collision:
 Duplicate module name: react-native-vector-icons
  Paths: /Users/collumj/research/k9fresh/ios/build/Build/Products/Debug-iphonesimulator/kisharNine.app/package.json collides with /Users/collumj/research/k9fresh/node_modules/react-native/local-cli/core/__fixtures__/files/package.json

No need for sudo when I encounter this.

Warning: destructive, check in first.

rm -rf android ios
git reset --hard
npm start

This fixes it every time. RN 0.39.2

edit: later, I think I fixed this by unlinking the react-native-vector-icons lib; I think the instructions I got made me double up on the linking or were out of date somehow.


I was getting errors like

Failed to build DependencyGraph: @providesModule naming collision:
Failed to build DependencyGraph: @providesModule naming collision:
Duplicate module name: accepts
Duplicate module name: accepts

I solved it by deleting npm's cache .npm and rerunning packager with --reset-cache

rm -rf ~/.npm

Posting this as an answer just in case anybody else has this issue in future.

Running npm start with sudo permissions grants the correct privileges when nodes package manager is running the initial build phase. This only seems to happen if the shell/user that you are running from has restricted privileges. Force escalating privileges to sudo gives the package manager full control to complete the build.