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

Can't install through npm #208

Open
kevnw opened this issue Oct 8, 2020 · 11 comments
Open

Can't install through npm #208

kevnw opened this issue Oct 8, 2020 · 11 comments

Comments

@kevnw
Copy link

kevnw commented Oct 8, 2020

Question

image
Trying to use the useDimensions library from @react-native-community/hooks but I can't install it. Any help?

@aradhya-gupta
Copy link

I have the exact same issue.

@LinusU
Copy link
Member

LinusU commented Oct 8, 2020

Hmm, I'm having a hard time seeing how this specific package could have caused this. Are you seeing this with any other package, or just ours?

@kevnw it seems like you are running this on a Window filesystem from Linux, is that a correct assumption? Does it work if you install the package to e.g. /tmp/foobar.

@aradhya-gupta what operating system and file system are you using?

@aradhya-gupta
Copy link

@LinusU I'm using windows 10

@aradhya-gupta
Copy link

I'm getting the following error while compilation of my app:

While trying to resolve module @react-native-community/hooks from file C:\Users\Aradhya\Desktop\DoneWith\App.js, the package C:\Users\Aradhya\Desktop\DoneWith\node_modules\@react-native-community\hooks\package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (C:\Users\Aradhya\Desktop\DoneWith\node_modules\@react-native-community\hooks\lib\index.js. Indeed, none of these files exist:

  • C:\Users\Aradhya\Desktop\DoneWith\node_modules@react-native-community\hooks\lib\index.js(.native|.android.expo.ts|.native.expo.ts|.expo.ts|.android.expo.tsx|.native.expo.tsx|.expo.tsx|.android.expo.js|.native.expo.js|.expo.js|.android.expo.jsx|.native.expo.jsx|.expo.jsx|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.wasm|.native.wasm|.wasm)
  • C:\Users\Aradhya\Desktop\DoneWith\node_modules@react-native-community\hooks\lib\index.js\index(.native|.android.expo.ts|.native.expo.ts|.expo.ts|.android.expo.tsx|.native.expo.tsx|.expo.tsx|.android.expo.js|.native.expo.js|.expo.js|.android.expo.jsx|.native.expo.jsx|.expo.jsx|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.wasm|.native.wasm|.wasm)

@randimaS
Copy link

I am also facing this issue with npm. It seems to be an issue specific to downloading with npm.
yarn adding works perfectly.
yarn add @react-native-community/hooks

@Mubashar-javed
Copy link

Facing the same issue with npm, any solution?

@zhengfen
Copy link

zhengfen commented Jan 8, 2021

I had a similar problem with npm install. For the moment I installed the package with yarn.

image

@Riamus78
Copy link

Uninstalling and reinstalling the library fixed it for me, don't know what went wrong the first time though

@SiddheshDabholkar
Copy link

SiddheshDabholkar commented Jul 4, 2021

use this command instead

npm install @react-native-community/hooks -f

or

yarn add @react-native-community/hooks

@barenzimo
Copy link

SiddheshDabholkar That worked for me. Had the same issue

@tarunfy
Copy link

tarunfy commented Aug 24, 2021

Having the same issue, please help :/

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

No branches or pull requests

10 participants