hooks
hooks copied to clipboard
Can't install through npm
Question
Trying to use the useDimensions library from @react-native-community/hooks but I can't install it. Any help?
I have the exact same issue.
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?
@LinusU I'm using windows 10
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)
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
Facing the same issue with npm, any solution?
I had a similar problem with npm install. For the moment I installed the package with yarn.
Uninstalling and reinstalling the library fixed it for me, don't know what went wrong the first time though
use this command instead
npm install @react-native-community/hooks -f
or
yarn add @react-native-community/hooks
SiddheshDabholkar That worked for me. Had the same issue
Having the same issue, please help :/