I've attempted to update my node version by deleting nodejs file from ProgramFilesx86 folder and using the windows installer to install the latest file. When I go to try and initialize a node project or npx create-react-app it gives me the following:
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Users\Mickell\AppData\Roaming\nvm\v13.8.0\node_modules\npm\node_modules\socks-proxy-agent\dist\agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Mickell\AppData\Roaming\nvm\v13.8.0\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Mickell\AppData\Roaming\nvm\v13.8.0\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:169:25)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
Could not determine Node.js install directory
What am I doing wrong?
This happens when you run a newer version of npm with an older version of node. Make sure no old version of node is in your path.
Related
I developed my NestJS application on my local MacBook Air M1. I built the app and copied the built files and folders + node_modules to the production server which is running Windows Server 2019 Standard. The production server does not have internet access for installing modules using for example yarn install command. When I try to run the application I get the following error:
C:\myproject\api>node main.js
internal/modules/cjs/loader.js:1122
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: \\?\C:\myproject\api\node_modules\argon2\lib\binding\napi-v3\argon2.node ist keine zulässige Win32-Anwendung.
\\?\C:\myproject\api\node_modules\argon2\lib\binding\napi-v3\argon2.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\myproject\api\node_modules\argon2\argon2.js:12:5)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\tubs\api\main.js:7444:18)
at __webpack_require__ (C:\tubs\api\main.js:20:30)
at Object.<anonymous> (C:\tubs\api\main.js:7355:16)
at __webpack_require__ (C:\tubs\api\main.js:20:30)
I have "argon2": "^0.28.5" in my package.json file for password encryption. I googled a lot but didn't see any similar issue.
I have created gatsby project as instructed in official website of gatsbyjs but it's not working.
NodeJS version: v16.15.0,
npm version: 8.8.0,
gatsby version: 4.13.0,
gatsby CLI version: 4.13.0
C:\Users\Dell\Desktop\New folder\my-app>npm run develop
> gatsby-starter-default#0.1.0 develop
> gatsby develop
C:\Users\Dell\Desktop\New folder\my-app\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
throw ex;
^
Error: The specified module could not be found.
\\?\C:\Users\Dell\Desktop\New folder\my-app\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 (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Dell\Desktop\New folder\my-app\node_modules\#parcel\source-map\parcel_sourcemap_node\index.js:15:18)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
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)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Dell\Desktop\New folder\my-app\node_modules\#parcel\source-map\dist\node.js:14:18)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
code: 'ERR_DLOPEN_FAILED'
}
Try removing your package-lock.json, your node_modules and run the npm install again.
If the issue persist try:
Bumping your gatsby-cli version
Downgrading your Node version (since you are in the latest LTS)
Switching to yarn
Related resources/workarounds:
https://github.com/gatsbyjs/gatsby/issues/23378
https://lifesaver.codes/answer/cli-yoga-layout-prebuilt-error-on-gatsby-build-24577
https://github.com/gatsbyjs/gatsby/issues/24577
/home/runner/stoneclane/node_modules/bindings/bindings.js:121
throw e;
^
Error: The module '/home/runner/stoneclane/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1185: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 (node:internal/modules/cjs/helpers:102:18)
at bindings (/home/runner/stoneclane/node_modules/bindings/bindings.js:112:48)
at new Database (/home/runner/stoneclane/node_modules/better-sqlite3/lib/database.js:48:64)
at Object. (/home/runner/stoneclane/node_modules/quick.db/src/index.js:7:15)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
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 (node:internal/modules/cjs/helpers:102:18)
at Object. (/home/runner/stoneclane/node_modules/quick.db/index.js:7:18)
at Module._compile (node:internal/modules/cjs/loader:1103:14) {
code: 'ERR_DLOPEN_FAILED'
}
exit status 1
I am trying to get into Discord bot making, and I have node installed, version 17.3.0.
When I try to run npm init in a blank folder on my desktop, it throws me this error:
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:161:25)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:161:25)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
It will throw me this error when I try to run any npm command. I have never seen any error like this before in this situation, and I haven't found any other person via google that's encountered this situation.
Any help is appreciated. I could be (probably am) overlooking something extremely simple and overthinking the f out of this.
Update:
The issue ended up being there was an old install of Node on my computer that did not properly uninstall when I tried to uninstall it. This caused all my issues. Thank you to everyone who tried to help, problem solved.
If anyone comes across this issue, the old version will be located in your nvm folder within your AppData directory.
That's a weird one. I would suggest using Node 16.13.1 LTS instead. LTS means Long Term Support. This means that it is probably more stable than that Node calls the "current" version. Also, since you are using Windows, try the installers available on Node.js' homepage instead of nvm. I've had issues with nvm in the past, though I've never tried it on Windows.
bcrypt seems like has mismatch with node.
my node version is 4.2.1
Error: Module version mismatch. Expected 46, got 14.
at Error (native)
at Object.Module._extensions..node (module.js:460:18)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at bindings (/opt/app/app/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)
at Object.<anonymous> (/opt/app/app/node_modules/bcrypt/bcrypt.js:3:35)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/opt/app/app/controllers/account.js:10:14)
at Module._compile (module.js:435:26)
You (typically) have to recompile addons when switching between "major" versions of node (e.g. v0.10, v0.12, 4.0, 5.0, etc). So an npm rebuild should do just this for you.