Error: Cannot find module './build/Release/DTraceProviderBindings' - node.js

I have a project that was created on Windows. After moving to macOS and trying to install and run it, I'm getting the following errors:
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/beygel/ITECH/Projects/Moovz-Server/stats/node_modules/dynamodb/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)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/beygel/ITECH/Projects/Moovz-Server/stats/node_modules/dynamodb/node_modules/bunyan/lib/bunyan.js:34:22)
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) code: 'MODULE_NOT_FOUND'
I'm using the following dependencies:
"dependencies": {
"simple-xmpp": "^1.3.0",
"dynamodb": "^1.1.2",
"html2plaintext": "^2.1.2",
"memcache-plus": "0.2.18",
"memjs": "^1.2.0",
"node-schedule": "^1.3.1",
"request": "^2.83.0",
"socket.io-client": "0.9.16"
}
System info:
node: v11.6.0
npm: 6.8.0
mbp2018: macOS Mojave version 10.14.3

I got rid of this error by running rm -rf node_modules and then running npm i --no-optional with dtrace-provider in my dependencies. It was at version 0.8.7.

This was resolved when I ran npm rebuild dtrace-provider

Related

When I try to run parcel, which is a node.js module, I get ERR_DLOPEN_FAILED error

EDIT: My problem is solved. Link for solution
First of all, hello everyone,
Although dependencies and dev dependencies are specified in the package.json file (I also downloaded the modules to the node_modules folder with the npm install command), I get the following error when I enter the npx parcel index.html command. What would be the reason?
"devDependencies": {
"#parcel/transformer-sass": "^2.6.0",
"parcel": "^2.6.0"
},
"dependencies": {
"bootstrap-icons": "^1.8.3"
}
Console output:
PS C:\Users\ubeyd\GitHub\countrypedia> npx parcel index.html
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Error: The specified module could not be found.
\\?\C:\Users\ubeyd\GitHub\countrypedia\node_modules\#parcel\source-map\parcel_sourcemap_node\artifacts\index.win32-x64-msvc.node
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1189:18)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (C:\Users\ubeyd\GitHub\countrypedia\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at Object.<anonymous> (C:\Users\ubeyd\GitHub\countrypedia\node_modules\#parcel\source-map\parcel_sourcemap_node\index.js:15:18)
at Module._compile (C:\Users\ubeyd\GitHub\countrypedia\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'ERR_DLOPEN_FAILED'
}

/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /node_modules/snappy/build/Release/binding.node)

I am running a loopback4 project inside a docker container which runs on centos 7 version. I have installed gcc inside docker but its still giving below error due to gcc version issue as CXXABI_1.3.9 is missing in gcc#4.8
/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /node_modules/snappy/build/Release/binding.node)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.wrappedLoad [as _load] (/node_modules/newrelic/lib/shimmer.js:373:24)
at Module.require (internal/modules/cjs/loader.js:692:17)
at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:80:39)
at require (internal/modules/cjs/helpers.js:25:18)
at bindings (/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/node_modules/snappy/snappy.js:2:34)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.wrappedLoad [as _load] (/node_modules/newrelic/lib/shimmer.js:373:24)
I cannot upgrade gcc due to some constraint to include CXXABI_1.3.9 so i started tracking down npm packages which were using CXXABI_1.3.9 and installed it on root level. Current package.json looks like below:
"dependencies": {
"#loopback/boot": "3.1.1",
"#loopback/core": "2.13.0",
"#loopback/repository": "3.2.1",
"#loopback/rest": "8.0.0",
"#loopback/rest-explorer": "3.0.4",
"#loopback/service-proxy": "3.0.4",
"gt-common": "1.0.2",
"kafka-node": "5.0.0",
"loopback-connector-mongodb": "^5.5.0",
"loopback-connector-rest": "^3.7.0",
"newrelic": "^6.14.0",
"tslib": "2.1.0",
"snappy": "6.3.5",
"bindings": "1.5.0",
"nan": "2.14.2",
"prebuild-install": "5.3.0"
}
But it did not work. Can someone please help me to resolve the above issue by changing the npm package's version which is using the CXXABI_1.3.9.
Thanks in advance.

node keystone Cannot find module './browserify'

Everything was working until I did a npm install on my project folder.
I am running macOS Sierra 10.12.5, node.js v8.2.1, npm v5.3.0
What I have tried:
uninstalling node/npm and reinstalling
npm install -g browserify
npm insatll browserify on my project folder
reinstall KeystoneJS generator
my package.json
{
"name": "site-name",
"version": "0.0.0",
"private": true,
"dependencies": {
"keystone": "4.0.0-beta.5",
"lodash": "^4.13.1",
"consolidate": "0.14.5",
"nunjucks": "3.0.0",
"node-sass": "4.5.0",
"node-sass-middleware": "0.11.0",
"dotenv": "4.0.0",
"async": "2.1.4",
"express-sslify": "1.2.0"
},
"devDependencies": {
"eslint": "3.15.0",
"eslint-config-keystone": "3.0.0",
"eslint-plugin-react": "^5.1.1"
},
"scripts": {
"lint": "eslint .",
"start": "node keystone.js"
}
}
Here is the output in terminal
node keystone
module.js:487
throw err;
^
Error: Cannot find module './browserify'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/Tyler/Desktop/Forge_Fitness_Site/models/node_modules/sha.js/bin.js:3:18)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at /Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:42:23
at Array.forEach (native)
at importer (/Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:32:26)
at /Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:36:22
at Array.forEach (native)
at importer (/Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:32:26)
at /Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:36:22
at Array.forEach (native)
at importer (/Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:32:26)
at Keystone.import (/Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/index.js:176:42)
at Object.<anonymous> (/Users/Tyler/Desktop/Forge_Fitness_Site/keystone.js:41:16)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
Well, I fixed the issue, not exactly sure how it happened but somehow I ended up with two node_modules folders in my project directory. Deleting the second one fixed my issue.

Heroku Cannot find module 'lodash/object/assign'

I'm having issues deploying to Heroku. Got it running locally after i had the same error by simply rm -f node_modules and then reinstalling them with npm install. But when i deploy to heroku the error keeps occurring. Even went in with bash to perform the same steps.
I then used npm shrinkwrap and noticed aws-sdk has a dependency on lodash vs 3.5.0 <3.6.0. So i set the lodash version in my package.json accordingly.
It all still runs locally but keeps crashing on heroku.
Node v5.0.0
NPM v3.3.6
"dependencies": {
"aws-sdk": "^2.6.6",
"bluebird": "^3.4.6",
"body-parser": "^1.15.2",
"express": "^4.14.0",
"goosepage": "0.0.1",
"lodash": "^3.5.0"
}
Additional heroku log
Error: Cannot find module 'lodash/object/assign'
Function.Module._resolveFilename (module.js:337:15)
Function.Module._load (module.js:287:25)
Module.require (module.js:366:17)
require (module.js:385:17)
Object.<anonymous> (/app/node_modules/xmlbuilder/lib/index.js:5:12)
Object.<anonymous> (/app/node_modules/xmlbuilder/lib/index.js:14:4)
Module._compile (module.js:425:26)
Object.Module._extensions..js (module.js:432:10)
Module.load (module.js:356:32)
Function.Module._load (module.js:311:12)
Module.require (module.js:366:17)
require (module.js:385:17)
Object.<anonymous> (/app/node_modules/aws-sdk/lib/xml/builder.js:2:15)
Module._compile (module.js:425:26)
Object.Module._extensions..js (module.js:432:10)
Module.load (module.js:356:32)
Turns out Heroku had a Buildpack that was caching node_modules. Turning off caching didnt help so i had to use the heroku plugin to clear the cached which worked.
https://github.com/heroku/heroku-repo
heroku repo:purge_cache -a appname
The following allegedly should also work incase the above doesn't
heroku config:set NODE_MODULES_TRUE=false

NodeJS Error: Module version mismatch. Expected 48, got 46

After I upgraded NodeJS and NPM to 6.2.0 and 3.9.3, when I run hexo d -g command to update my blog, I get the following error:
Error: Module version mismatch. Expected 48, got 46.
at Error (native)
at Object.Module._extensions..node (module.js:568:18)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider/dtrace-provider.js:17:23)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/bunyan/lib/bunyan.js:79:18)
{ Error: Cannot find module './build/default/DTraceProviderBindings'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider/dtrace-provider.js:17:23)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/bunyan/lib/bunyan.js:79:18)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/Debug/DTraceProviderBindings'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/dtrace-provider/dtrace-provider.js:17:23)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/bunyan/lib/bunyan.js:79:18)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32) code: 'MODULE_NOT_FOUND' }
(node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
(node) and will stop working in the next major release.
I thought maybe Node.js is upgraded and node_modules should be reinstalled.
I tried rm -rf node_modules && npm install, but it doesn't work. I also tried sudo npm i -g npm then npm install hexo --no-optional --save, which doesn't work neither.
Any advice would be most appreciated.
Actually, after upgrading node, your installed packages kept compiled against the older version, and they need to be rebuilt. No need to delete node_modules, or running npm update.
Just run:
npm rebuild
Hexo doesn't seem to work with lastest version of node which is 6.2.0. You should use node-v4.4.5 (LTS) for a while, which is recommended version for most users.
It looks like hexo is a globally installed package, but you only reinstalled it locally. Try to reinstall it globally:
npm install hexo -g
Maybe your Global installation files has not been update, please try to update your hexo-cli with command below:
sudo npm install -g hexo-cli
which solved my problem.

Resources