Cannot find module 'semver' - node.js

node:internal/modules/cjs/loader:936
throw err;
^
/am finding this error even after remoning installed node/
Error: Cannot find module 'semver'
Require stack:
- /usr/share/nodejs/npm/lib/utils/unsupported.js
- /usr/share/nodejs/npm/lib/cli.js
- /usr/share/nodejs/npm/bin/npm-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/usr/share/nodejs/npm/lib/utils/unsupported.js:1:16)
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) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/share/nodejs/npm/lib/utils/unsupported.js',
'/usr/share/nodejs/npm/lib/cli.js',
'/usr/share/nodejs/npm/bin/npm-cli.js'
]
}
Node.js v17.4.0

did you installed semver module ?
You can try to install semver with command:
npm install semver --save

Related

Vuepress can't find module Require stack:

I'm getting this error when I use the command yarn dev
is there any way to fix this?
PS C:\Users\Maximiliano\Desktop\guia front-end method\docs> yarn dev
yarn run v1.22.19
$ vuepress dev src
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'chalk'
Require stack:
- C:\Users\Maximiliano\Desktop\guia front-end method\docs\node_modules\#vuepress\shared-utils\lib\datatypes.js
- C:\Users\Maximiliano\Desktop\guia front-end method\docs\node_modules\#vuepress\shared-utils\lib\index.js
- C:\Users\Maximiliano\Desktop\guia front-end method\docs\node_modules\vuepress\lib\checkEnv.js
- C:\Users\Maximiliano\Desktop\guia front-end method\docs\node_modules\vuepress\cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Maximiliano\Desktop\guia front-end method\docs\node_modules\#vuepress\shared-utils\lib\datatypes.js:7:33)
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) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Maximiliano\\Desktop\\guia front-end method\\docs\\node_modules\\#vuepress\\shared-utils\\lib\\datatypes.js',
'C:\\Users\\Maximiliano\\Desktop\\guia front-end method\\docs\\node_modules\\#vuepress\\shared-utils\\lib\\index.js',
'C:\\Users\\Maximiliano\\Desktop\\guia front-end method\\docs\\node_modules\\vuepress\\lib\\checkEnv.js',
'C:\\Users\\Maximiliano\\Desktop\\guia front-end method\\docs\\node_modules\\vuepress\\cli.js'
]
}
error Command failed with exit code 1.
Snapshot of the above error

Error: Cannot find module 'react-dev-utils/WatchMissingNodeModulesPlugin'

I have React.js application with the connection of Rust. Problem is about running the application. When I try to run npm start it return this error:
throw err;
^
Error: Cannot find module 'react-dev-utils/WatchMissingNodeModulesPlugin'
Require stack:
- /Users/elchinfarhad/Desktop/IndoorNavigation/react-client/config/webpack.config.js
- /Users/elchinfarhad/Desktop/IndoorNavigation/react-client/scripts/start.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/elchinfarhad/Desktop/IndoorNavigation/react-client/config/webpack.config.js:19:39)
at Module._compile (node:internal/modules/cjs/loader:1099:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/elchinfarhad/Desktop/IndoorNavigation/react-client/config/webpack.config.js',
'/Users/elchinfarhad/Desktop/IndoorNavigation/react-client/scripts/start.js'
]
}
Point is it was working before and I did not change anything, but later when I try npm start it return the above error. I try to delete node_modules and package-lock.json and install again but nothing changes. Can someone please help how can I solve this problem.
I encountered the same problem. It is probably about your npm version. I downgraded my npm version to 6.14.11, and the problem was solved.
npm install -g npm#6.14.11

Getting error while hashing password with bcrypt: can not find module bcrypt_lib.node

I'm working on an api project with node.js and receive this error while trying to hash my code with bcrypt package :
throw err;
^
Error: Cannot find module '/home/emad/work/node.js/npm-demo/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node'
Require stack:
- /home/emad/work/node.js/npm-demo/node_modules/bcrypt/bcrypt.js
- /home/emad/work/node.js/npm-demo/routes/users.js
- /home/emad/work/node.js/npm-demo/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/emad/work/node.js/npm-demo/node_modules/bcrypt/bcrypt.js:6:16)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/emad/work/node.js/npm-demo/routes/users.js:1:16)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/emad/work/node.js/npm-demo/index.js:8:14)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/emad/work/node.js/npm-demo/node_modules/bcrypt/bcrypt.js',
'/home/emad/work/node.js/npm-demo/routes/users.js',
'/home/emad/work/node.js/npm-demo/index.js'
]
}
My OS is a Ubuntu 18.04.5 LTS and I installed all the dependecies that was written down in bcrypt page in npm site
try below steps and run:-
Delete node_modules folder
run npm cache clean --force
npm install

The problem with npm - internal/modules/cjs/loader.js:968

Good day!
I reinstalled Node.js to the latest version, from the Linux terminal and now npm gives the following error:
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'semver'
Require stack:
- /usr/local/lib/node_modules/npm/lib/utils/unsupported.js
- /usr/local/lib/node_modules/npm/bin/npm-cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/unsupported.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/local/lib/node_modules/npm/lib/utils/unsupported.js',
'/usr/local/lib/node_modules/npm/bin/npm-cli.js'
]
}
How can you fix this?
try npm install semver or try to delete existing node_moudles folder and run npm install command

Cannot find module 'coffee-script' using require grunt

Cannot find module 'coffee-script' using grunt from a script
module.js:338
throw err;
^
Error: Cannot find module 'coffee-script'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:\Users\Safa\node_modules\grunt\lib\grunt.js:16:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
Try running
npm install coffee-script#
and then running it again. It is recommended adding it to your package.json file if you haven't already, so in the future you can simply run
npm install

Resources