Requiring unknown module ./bindings on react native - node.js

I'm trying to run my react-native project on android but when I try to execute it I get the following error on the android simulator:
"Requiering unknown module ./bindings. If you are sure the module is
there, try restarting the packager or running npm install"
The thing is that I have checked up node_modules and I can see that the module is there. I have already tried to remove node_modules and install all of them again but didn't work.
I have also tried to install bindings with npm install bindings and I get the following error:
npm WARN optional Skipping failed optional dependency
/noble/bluetooth-hci-socket:
npm WARN notsup Not compatible with your operating system or
architecture: bluetooth-hci-socket#0.4.4
I'm on MACOS

Related

Angular cli not working in Git Bash terminal on Windows

I've been trying to install the Angular CLI via npm. My current node version is v11.2.0 and my npm version is 6.4.1.
After running the command npm install -g #angular/cli I get this output:
C:\Users\Mark O'Hare\AppData\Roaming\npm\ng -> C:\Users\Mark O'Hare\AppData\Roaming\npm\node_modules\#angular\cli\bin\ng
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\#angular\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
and when I try ng -v I get this error message:
internal/modules/cjs/loader.js:605
throw err;
^
Error: Cannot find module 'C:\c\Users\Mark O'Hare\AppData\Roaming\npm\node_modules\#angular\cli\bin\ng'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:775:12)
at startup (internal/bootstrap/node.js:300:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:826:3)
Things I've tried so far:
Uninstalling angular via npm and reinstalling
Uninstalling node.js and deleting npm folders, restarting machine and reinstalling
Creating alias's for 'ng' with the path to the ng file in the npm node_modules folder
So far none of these have worked. Can anyone help or suggest a workaround?
I guess the problem lies within the user folder Mark O'Hare:
Error: Cannot find module 'C:\c\Users\Mark O'Hare\AppData\Roaming\npm\node_modules\#angular\cli\bin\ng' --> it reads the string until the second apostrophe, which is inside O'Hare, ultimately reading the folder as
C:\c\Users\Mark O
You can also try to use linux subsystem.
I would recommend it as it's easier to make JS env working.
https://learn.microsoft.com/en-us/windows/wsl/install-win10
i think folder name Mark O'Hare is the issue.
Instead of global installation try to install it in local and try to run the cli

npm install error (code EBADPLATFORM)

When I tried to run npm install, it gave me this error:
$ npm install
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents#1.1.3: wanted
{"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Aroma\AppData\Roaming\npm-cache\_logs\2018-03-
25T11_33_58_338Z-debug.log
The node version:
$node -v
v8.10.0
I tried every thing, like:
npm cache clear
npm cache verify
npm i -g npm#latest
I even tried uninstalling and reinstalling Nodejs again but still get the same error.
I had the same issue, deleting my "package-lock.json" and re-running npm install worked
For those having issue on render.com
remove package-lock.json from your repo or add to gitignore
then run the build command npm install ; npm run build using the build from last comment option on render.com dashboard
Error is indicating that you are installing fsevents module in other OS rather than Mac
fsevents module only works for Mac Operting system
This worked effortless for me on Windows:
Go to project's "package-lock.json" file.
Press "Ctrl+F" (to enable keyword search).
Type "darwin".
Wherever it says "darwin" in the file, change that to "win32".
Restart your VS Code and you should be good to go.
Add following to your project's package.json
"optionalDependencies": {
"fsevents": "*"
},
and then install with --no-optional
Same npm install error (code EBADPLATFORM):
I had forced fsevents onto my windows machine npm i -f fsevents...
npm responded "I hope you know what your doing".
To repair, needed to
delete package-lock.json
delete line: fsevents#2.3.2 in package.json (your suffix may differ)
re-ran npm install
Remove "fsevents": "version", on package.json if you try to install on Windows.
I'm developing on Mac. I deleted "os": [ "darwin" ] from package.lock.json, ran the build, deployed to my Google Cloud App Engine project, and it finally worked.
Source: belykh's comment (Nothing posted in any of the other answers helped me.)
The error says it all:
Unsupported platform for fsevents#1.1.3:
wanted {"os":"darwin","arch":"any"}
(current: {"os":"win32","arch":"x64"})
This module doesn't support Windows, you can't use it if you're on Windows.
I think In your Project Folder First Delete package.lock.json and then try:
npm install
This is Works For Me.
I had this same issue on my dev machine (Win 10 x64). I had no intention of running or using fsevents locally. I just needed to upgrade my local copy of fsevents, to resolve a vulnerability. Running with the -f option solved it:
npm install fsevents#1.2.9 -f
Note: -f means "force installation". npm gives an ominous warning like "I hope you know what you're doing". Afaik fsevents isn't dangerous to have on a win32 machine. It only "works" on mac. The npm page for fsevents says "This is a low-level library. For a cross-platform file watching module that uses fsevents, check out Chokidar". I was only upgrading and wasn't choosing to use it on a win32 machine. So keep that in-mind.
That being-said, it didn't break anything for me. No BSoDs, errors, etc. App still works. Build works. All good.
This error message says that fsevents package does not support your operating system. In my case the solution for this error was to upgrade npm to the latest version.
please first delete package-lock.json file and remove "win-node-env": "^0.4.0" this line from package.json
This is what worked for me:
Delete node_modules
Delete package-lock.json
run npm i
Add peer dependency in your JSON package like below
{
"name": "chai-as-promised",
"peerDependencies": {
"chai": "1.x"
}
}

npm ENOENT error in installing package

I was installing an encryption package for node when I received this ENOENT error.
$ npm install crypto2
C:\Users\adity
`-- crypto2#0.3.1
`-- node-rsa#0.4.2
`-- asn1#0.2.3
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\adity\package.json'
npm WARN adity No description
npm WARN adity No repository field.
npm WARN adity No README data
npm WARN adity No license field.
As for looking in the path the error describes, I looked there and found an old version. I did an uninstall from npm (which also received the same error). Then I had to manually remove it and empty from the trash.
I also tried to install it globally, again, to no success.
I am using git bash command prompt for this, and tried the same thing with node.js command prompt with it returning the same errors. The package I'm installing is (if this will be any help) : https://www.npmjs.com/package/crypto2
EDIT: I just discovered this problem isn't just with the encryption package but any package that I try to install. When I tried installing Requirejs, same error. This is weird, because I installed a couple of packages yesterday (Passport.js) which installed perfectly without any hiccups whatsoever.
It's just warning you that it didn't find a package.json. If you don't have one or need one, then you can just ignore it.
If you want to create one and add the dependencies to it automatically, you could do:
npm install crypto2 --save

NPM Installation failed

I have downloaded latest version of nodejs for windows.
When I run command npm install it install some package and at last it gives me error
npm WARN optional Skipping failed optional dependency
/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or
architecture:fsevents#1.0.14
npm WARN vue-jwt-auth-example#1.0.0 No repository field.
I am trying to run Vue.js JWT Authentication
Please help, to fix this.
These are warnings, not errors, so everything still should run fine.
fsevents is an optional dependency, and because it is not supported by your operating system, it is skipped.
The other warning is related to you not having a repository field in your package.json file, so just something to tell you to fix, but not mandatory.
Everything should work fine!

npm WARN install Couldn't install optional dependency: Unsupported

I received this warning message:
npm WARN install Couldn't install optional dependency: Unsupported
when I ran the command:
$ npm i adaro --save
What does this warning mean? What is an optional dependency? Is it serious? How do I get rid of that warning?
The warning message is just a warning message and not an error. It does not affect the application.
It is a log message that an optional dependency could not be installed because it is not supported/needed on your current platform/cpu-arch. For example the package fsevents is often used as optional dependency but fails on any system that is not a Mac.
To show what package is throwing this message, run
$ npm install --verbose
This warning could also be triggered by packages having an engine set to something lower than what you are running. You can try
$ pm_config_engine_strict=false npm install
to get around this

Resources