I`m installing this server - https://github.com/surespot/web-server. I installed node.js, npm, CoffeScript and all dependencies
apt-get install nodejs npm
npm install -g coffee-script#1.6.3
npm install
When I execute command coffee server/cluster.coffee, I get the error:
Error: Cannot find module 'iap_verifier'
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 Object.<anonymous> (/var/www/web-server/server/cluster.coffee:35:15, <js>:64:17)
at Object.<anonymous> (/var/www/web-server/server/cluster.coffee:1:1, <js>:4482:4)
at Module._compile (module.js:456:26)
but module files exist in node_modules dir.
I also try manualy install module
npm install iap_verifier
and
npm install iap_verifier -g
Make sure you required the module in the main app.js file and try running sudo npm install iap_verifier -g
Related
First time posting, please be gentle...
Trying to follow along with Kevin Powell tutorial on setting up gulp to automate some SCSS compiling etc - link below
https://www.youtube.com/watch?v=QgMQeLymAdU&t=633s
Fairly confident I followed the instructions correctly but when trying to run the gulp style command I'm getting the following error.
node_modules seems to be set up correctly in the root folder when installed and package.json has gulp in the dependencies as well.
Any help would be fantastic.
Error: Cannot find module 'gulp;'
Require stack:
- C:\Users\Admin\OneDrive\Desktop\test\gulpfile.js
- C:\Users\Admin\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\shared\require-or-import.js
- C:\Users\Admin\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^3.7.0\index.js
- C:\Users\Admin\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\index.js
- C:\Users\Admin\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (C:\Users\Admin\OneDrive\Desktop\test\gulpfile.js:1:14)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Admin\\OneDrive\\Desktop\\test\\gulpfile.js',
'C:\\Users\\Admin\\AppData\\Roaming\\npm\\node_modules\\gulp\\node_modules\\gulp-cli\\lib\\shared\\require-or-import.js',
'C:\\Users\\Admin\\AppData\\Roaming\\npm\\node_modules\\gulp\\node_modules\\gulp-cli\\lib\\versioned\\^3.7.0\\index.js',
'C:\\Users\\Admin\\AppData\\Roaming\\npm\\node_modules\\gulp\\node_modules\\gulp-cli\\index.js',
'C:\\Users\\Admin\\AppData\\Roaming\\npm\\node_modules\\gulp\\bin\\gulp.js'
]
}
Tried deleting node_modules and npm install againw it the same issues.
If you have any previously installed gulp globally, Uninstall them using the below command :
run npm rm --global
and then try running the below and install gulp-cli globally:
npm install --global gulp-cli
And then go to your project directory and run the below command:
npm install --save-dev gulp
Please find the official gulp documentation here
I encountered this error when I run npm start to view my react app.
> react-scripts start
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'side-channel'
Require stack:
- C:\Users\USER-PC\Documents\Projects\frontend\Info_site\node_modules\qs\lib\stringify.js
- C:\Users\USER-PC\Documents\Projects\frontend\Info_site\node_modules\qs\lib\index.js
- C:\Users\USER-PC\Documents\Projects\frontend\Info_site\node_modules\webpack-dev-server\node_modules\express\lib\middleware\query.js
- C:\Users\USER-PC\Documents\Projects\frontend\Info_site\node_modules\webpack-dev-server\node_modules\express\lib\application.js
- C:\Users\USER-PC\Documents\Projects\frontend\Info_site\node_modules\webpack-dev-server\node_modules\express\lib\express.js
- C:\Users\USER-PC\Documents\Projects\frontend\Info_site\node_modules\webpack-dev-server\node_modules\express\index.js
- C:\Users\USER-PC\Documents\Projects\frontend\Info_site\node_modules\webpack-dev-server\lib\Server.js
- C:\Users\USER-PC\Documents\Projects\frontend\Info_site\node_modules\react-scripts\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:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\USER-PC\Documents\Projects\frontend\Info_site\node_modules\qs\lib\stringify.js:3:22)
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) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\USER-PC\\Documents\\Projects\\frontend\\Info_site\\node_modules\\qs\\lib\\stringify.js',
'C:\\Users\\USER-PC\\Documents\\Projects\\frontend\\Info_site\\node_modules\\qs\\lib\\index.js',
'C:\\Users\\USER-PC\\Documents\\Projects\\frontend\\Info_site\\node_modules\\webpack-dev-server\\node_modules\\express\\lib\\middleware\\query.js',
'C:\\Users\\USER-PC\\Documents\\Projects\\frontend\\Info_site\\node_modules\\webpack-dev-server\\node_modules\\express\\lib\\application.js',
ules\\express\\lib\\application.js',
'C:\\Users\\USER-PC\\Documents\\Projects\\frontend\\Info_site\\node_modules\\webpack-dev-server\\node_modules\\express\\lib\\express.js',
'C:\\Users\\USER-PC\\Documents\\Projects\\frontend\\Info_site\\node_modules\\webpack-dev-server\\node_modules\\express\\lib\\express.js',
'C:\\Users\\USER-PC\\Documents\\Projects\\frontend\\Info_site\\node_modules\\webpack-dev-server\\node_modules\\express\\index.js',
'C:\\Users\\USER-PC\\Documents\\Projects\\frontend\\Info_site\\node_modules\\webpack-dev-server\\lib\\Server.js',
'C:\\Users\\USER-PC\\Documents\\Projects\\frontend\\Info_site\\node_modules\\react-scripts\\scripts\\start.js'
]
}
And then I tried to install the module with this command:
npm i side-channel
I still got an error:
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\USER-PC\AppData\Local\npm-cache\_logs\2022-10-04T15_30_26_716Z-debug-0.log
What could possibly be the problem? I ran the start command just after installing the dependencies with 'npm install' command.
It worked now. I had to delete the yarn.lock in my project, after deleting the node_modules file, then I ran the command again: npm install
You can try removing node_modules and reinstalling all modules with npm install
To show your modules as of npm 7 for windows:
Global modules: npm ls --link --global
Local modules: npm ls --link
To unistall package run
npm uninstall <module_name>
To install just run
npm install <module_name>
The best solution i have found for this problem is to uninstall and reinstall react.
This will uninstall React
to make sure it's there and show dependencies run
npm ls -g --depth=0
output:
F:\Dev\NodeJS\node22
+-- create-react-app#5.0.1
+-- express#4.14.0
to uninstall run
npm unistall -g create-react-app
to install run
npm install -g create-react-app
Hello I am new in a nodejs and when I run any file in command prompt like:-
C:\demoData>node demo.js
I get error li9ke this
module.js:327
throw err;
^
Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\demoData\shahzad.js:1:77)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
I did R&D and get the solution
npm install express
And my Problem has solved using this. But Why I required this I have already express folder globally.this path
C:\Users\broswire\AppData\Roaming\npm\node_modules;
I want to use this node_modules, I don't want locally node_modules.
Node encourages using locally installed modules. Generally, using modules installed with npm install --global or npm install -g should be reserved for cli tools and things used systemwide. So to use express in a project, it is recommended to npm install express in that directory. It is also useful to add a package.json file to save the versions of your dependencies. Then you can just navigate to your project and run npm install and it will install the required dependencies.
I tried to setup ghost after installing node.js but as I run the install for ghost as
npm install --productions
It gives me the following error
> ghost#0.5.10 start /home/kedarkhetia/Downloads/ghost-0.5.10
> node index
module.js:340
throw err;
^
Error: Cannot find module 'streamsearch'
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 Object.<anonymous> (/home/kedarkhetia/Downloads/ghost-0.5.10/node_modules/busboy/node_modules/dicer/lib/Dicer.js:5:20)
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)
at Module.require (module.js:364:17)
npm ERR! weird error 8
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
any help is appreciated.
Try running
npm install streamsearch
Does this work?
This may be related:
Cannot install packages using node package manager in Ubuntu
Make sure you have installed streamsearch.
npm install streamsearch
If it is still not working, check that you have cloned stable for production or not. If you did, re-clone it and do installation steps again. Use sudo for npm/grunt commands (if you are on OSX or Linux) for npm ERR!.
I just looked at the Ghost Docs, and it says to install the dependencies for production you must run npm install --production and not npm install --productions. Once you install streamsearch, it will keep complaining until you have installed all the individual dependencies with npm install --production.
Hope this helps!
I have node.js install on linux, and file.js. In the same directory I have node_modules directory with lru-cache module.
file.js does the following:
var lrucache = require('lru-cache')
But when I run it, it raises the following error:
Error: Cannot find module 'lru-cache'
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 Object.<anonymous> (/opt/file.js:58:12)
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)
at Function.Module.runMain (module.js:497:10)
What is the problem? the same is working in other linux system.
Please try:
rm -rf node_modules && npm cache clean && npm install
Sometimes npm has an issue and the dependency lru-cache may not get properly installed.
Most node modules will have their own set of package dependencies so you cannot just copy the folder or clone the repository without making sure you are satisfying the module's dependencies.
The easiest way would be using npm for ALL package installations.
After you have run npm init in your project's root directory to set up your package.json use
$ npm install modulename --save
to install a package AND its dependencies. You can now safely use
var module = require('modulename');
throughout your whole project.
In case you cannot install your package via npm make sure all of its dependencies are installed as well by navigating to node_modules/modulename and running npm install (no arguments) here. This will install all dependencies that are listed in the modules own package.json file.