Couchbase Node compiled against different node version - node.js

Getting this error when I run in unix system
Error: The module '/app/node_modules/couchbase/build/Release/couchbase_impl.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 57. This version of Node.js requires NODE_MODULE_VERSION 59. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (module.js:678:18)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
at bindings (/app/node_modules/bindings/bindings.js:81:44)
at Object.<anonymous> (/app/node_modules/couchbase/lib/binding.js:203:36)
at Module._compile (module.js:649:30)
at Object.Module._extensions..js (module.js:660:10)
I tried below solutions and it didn't helped
1)
$ rm -rf node_modules/couchbase
$ npm install
2)
$ rm -rvf node_modules/couchbase
$ npm install
3)
npm rebuild couchbase --update-binary
4)
npm uninstall couchbase
npm install couchbase
5)
deleted node_modules folder and ran - npm install
while installing or rebuilding i don't get any errors, but during runtime I get these errors. Please help me with solution to this problem.

Related

All npm commands are throwing the same error, including version check(npm -v). Unlike other questions Not a single npm command is working

Installed Node version 12.13.0 on windows 10. All npm commands throws the following error:
C:\Users\Jahangeer> npm -v
evalmachine.<anonymous>:27
const { Math, Object } = primordials;
^
ReferenceError: primordials is not defined
at evalmachine.<anonymous>:27:26
at Object.<anonymous>
(C:\Users\Jahangeer\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\fs.js:11:1)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous>
(C:\Users\Jahangeer\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-
fs.js:3:27)
at Module._compile (internal/modules/cjs/loader.js:956:30)
Tried uninstalling and installing few other older Node versions. The Problem remains.
Use these commands to install node 11 and gulp 3 and check:
npm install -g n
sudo n 11.15.0
npm install gulp#^3.9.1
npm install
npm rebuild node-sass

Cannot find module './build/Debug/DTraceProviderBindings'

I know this question has been asked lots of times like
here and here.
I have tried all suggestions on these links and more..
I tried installing the latest bunyan
sudo npm install bunyan#1.8.12 --unsafe-perm=true --allow-root
I installed and rebuilt latest dtrace-provider
sudo npm install dtrace-provider#0.8.7 --unsafe-perm=true --allow-root
sudo npm rebuild dtrace-provider#0.8.7 --unsafe-perm=true --allow-root
it built the module successfully.
+ NODE_GYP_STATUS=0
+ [[ 0 -ne 0 ]]
+ exit 0
touch Release/obj.target/ndtp.stamp
npm WARN swaggerize-express#4.0.5 requires a peer of express#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN tr-stack#1.0.0 No repository field.
+ dtrace-provider#0.8.7
In spite of that I am still getting this error:
Error: Cannot find module './build/Release/DTraceProviderBindings'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/yogeshsingh/TradeRev/code/tr-stack/node_modules/vogels/node_modules/dtrace-provider/dtrace-provider.js:17:23)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
node version and npm version are as follows:
node: v11.6.0
npm : 6.5.0

npm completely won't work: "Error: Cannot find module 'isarray'"

So every time I try us any npm command I get the same error:
module.js:472
throw err;
^
Error: Cannot find module 'isarray'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:32:15)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
Even when I try running npm install isarray I get the same exact error.
I've tried uninstalling the dependencies and then running npm install and I get the same error. I've tried completely reinstalling npm AND node and I still get the same error.
If I need this package to install this package I don't know what else to do.
In my case, this was cause of node and npm version.
Try to update your node and npm version.
First, Node update is
//Clean node Cache
sudo npm cache clean -f
//Install n Module
sudo npm install -g n
//Install stable Node version Using n Module
sudo n stable
IF this is not worked, then use 'nvm' (In my case, below is worked.)
nvm install 8.10.0
You can check your node version by 'node -v'
Second, npm update.
sudo npm install -g npm
You can also check your npm version by 'npm -v'
I hope this will be helpful!

npm Error “ Cannot find module 'npmlog' ”

I am running CentOS 6 and after logging in, I encounter the following error
module.js:340
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /home/dspace/.nvm/v0.10.31/bin/npm:19:11
at Object.<anonymous> (/home/dspace/.nvm/v0.10.31/bin/npm:87:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `npm config delete prefix` or `nvm use --delete-prefix v0.10.31 --silent` to unset it.
I've discovered that it is a version bug and can be resolved either by upgrading the npm version or by deleting the node modules like so;
rm -rf node_modules
Then reinstalling them;
npm install
After removing the modules, npm install failed to run because of missing dependancies i.e. the modules. Now the command shows no response at all.
My node version is v0.10.48
This worked for me
Install nvm:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
Restart the terminal
Run
nvm install node
 
I had the same problem after proposed npm upgrade via npm -i -g npm. But Fedora npm/node installed via dnf has modules links to /usr/lib/node_modules/npm/node_modules.bundled/ from /usr/lib/node_modules/npm/node_modules/. I saw links were broken because usr/lib/node_modules/npm/node_modules.bundled/ disappeared. So reinstallation node,nodejs,npm via dnf/rpm solved the problem.

error cannot find module 'umask'

I just installed nodejs x64 on my Windows 10 computer. I keep all default config,
I open cmd and type:
npm -v
Then i got following error:
module.js:457
throw err;
^
Error: Cannot find module 'umask'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\W10-PRO\AppData\Roaming\npm\node_module\npm\lib\utils\umask.js:1:75)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
Every command start with "npm" create this error and npm cannot uninstall, update itself)
Please help me fix this error?
update your npm
$ npm install npm -g
I would try to update/install NPM
$ npm update -g npm
I know the answer!
Uninstall nodejs.
Delete all references to npm and nodejs (Program Files, Program Files(x86).
Then also delete those in AppData/Roaming (npm and npm-cache to be sure).
Reinstall nodejs.
It works!

Resources