Cannot find module 'iconv' - node.js

After I installed gulp,I execute the following command
I tried following steps,
1.npm install
versions
npm :- 6.9.0,
node :- 10.15.13,
python :- 2.7.10
2.npm install gulp
versions
CLI version :- 3.9.1,
Local version :- 3.9.1
And I Also tried globaly,its also showing same error
> npm install -g gulp
After Install gulp in above version and run the following command
gulp like
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'iconv'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (C:\cygwin64\home\D-218\workspace\shima\src\tasks\json.js:4:14)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)

You have only installed Gulp on you system. Gulp is a task runner. One of your tasks requires using iconv. The error is showing the module "iconv" is not found. Install it with the below, add "-g" if you want install system wide rather than just in this project directory.
npm install iconv
Then in your gulp file import iconv with a line as follows:
var Iconv = require('iconv').Iconv;
Rerun your task and it should execute fine.

Related

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!

`ember install emberfire` failed, is ember-cli-emberfire a better route with Node 6.2.2?

Cannot find module 'q' and more…
When I run ember install emberfire in an existing Ember app, I get Cannot find module 'q'.
I searched the issue, tried npm cache clean and npm install q.
Now, ember install emberfire throws Cannot find module '../function/makeIterator_' and I'm reluctant to go further.
However, at npm-embercli-emberfire the advice is to install via Bower with npm install --save-dev ember-cli-emberfire - to quote:
This repo lists emberFire as a bower dependency
It runs bower install as the npm postinstall script
it exports a tree containing both the firebase and emberFire libraries
Do node 6.2.2 and ember-cli play nicely yet?
Since the machinations of npm and Node become an irritating mystery when I'm trying to focus on an Ember (tutorial) app, I'd like to know:
how running ember install emberfire differs, and if running it before running the npm-recommended command is an issue?
If it's okay to run ember-cli with node 6.2.2 - if not, suggestions?
My setup
OS X 10.11.6 (and just had to chown -R usr/local after an OS X update).
node 6.2.2 (which apparently "has currently not been tested against Ember CLI and may result in unexpected behaviour.")
Ember: 1.13.15
ember-cli: 1.13.15
ember-data: 2.7.0
node: 6.2.2
npm: 2.14.10
emberfire: 2.0.1
ember-cli-emberfire: 0.0.1
The full error readout:
$ ember install emberfire
version: 1.13.15
Installed packages for tooling via npm.
installing emberfire
identical app/adapters/application.js
Cannot find module 'q'
Error: Cannot find module 'q'
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> (/Users/admin/projects/solutions-log/node_modules/ember-cli/node_modules/bower/lib/commands/index.js:1:71)
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)
$ npm cache clean
$ npm install q
solutions-log#0.0.0 /Users/admin/projects/solutions-log
└── q#1.4.1
$ ember install emberfire
version: 1.13.15
Installed packages for tooling via npm.
installing emberfire
identical app/adapters/application.js
Cannot find module '../function/makeIterator_'
Error: Cannot find module '../function/makeIterator_'
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> (/Users/admin/projects/solutions-log/node_modules/ember-cli/node_modules/bower/lib/node_modules/mout/array/collect.js:2:20)
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)

Getting error: Cannot find module 'errno' running node script

I've just installed a fresh copy of Ubuntu 15.10, node 4.2.2 and npm 2.14.7 (with nvm) on a new machine. I have installed webpack and webpack-dev-server globally and installed my project dependencies with npm i.
Now when I try to run my node server I get the following errors:
module.js:339
throw err;
^
Error: Cannot find module 'errno'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/node_modules/webpack-dev-middleware/node_modules/memory-fs/lib/MemoryFileSystem.js:7:14)
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)
Any suggestions please?
Node.js searches for modules in the ./node_modules/ directory in the path where the program is.
For example if you script is here /home/user/scripts/somescript.js you should have /home/user/scripts/node_modules/.
Just do npm install errno in here /home/user/scripts/.
It seems that something had gone wrong with my npm install and my project dependencies were only partly installed. Just running npm install again didn't fix it. I did an npm cache clean, removed my node_modules directory and then ran npm install again. The problem was then resolved.

Gulp error (module not found)

I have installed npm locally according to an article (I don't remember the URL). So that my npm packages are in ~/.npm-packages/. So gulp is in ~/.npm-packages/bin/gulp and this is a link: gulp -> ../lib/node_modules/gulp/bin/gulp.js
When I run which gulp I got /home/victor/.npm-packages/bin/gulp
When I go to the bin directory and run gulp like ./gulp.js -v I can see it works. However, when I run gulp globally I got such error:
module.js:338
throw err;
^
Error: Cannot find module '/usr/lib/node_modules/gulp/node_modules/v8flags/3.28.73.flags.json'
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> (/usr/lib/node_modules/gulp/bin/gulp.js:25:22)
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 Function.Module.runMain (module.js:501:10)
So gulp is trying to find modules in /usr/lib, but why? Why not in my home directory? I have all these modules in ~/.npm-packages/lib/node_modules/gulp/node_modules
I'm absolutely confused and can't get gulp working. I've tried to reinstall it with the same effect.
This is what I did to solve the problem:
cd /usr/lib/node_modules/gulp/node_modules/v8flags
sudo node fetch.js
And that's it. The last instruction will create the required file.
This is what I did to solve the problem:
sudo npm install gulp && sudo npm install --save del && sudo gulp build

node.js returns "Cannot find module 'lockit-mongodb-adapter'"

I am going through my first node.js project. I've installed lockit , have a app.js file, and when I try to run it I get this error
module.js:340
throw err;
^ Error: Cannot find module 'lockit-mongodb-adapter'
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 new module.exports (C:\Users\xx\Documents\mailer\index.js:38:44)
at Object.<anonymous> (C:\Users\xx\Documents\mailer\examples\mongodb\app. js:32:14)
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)
I am quite certain I have lockit-mongodb-adapter installed.
You need to install the module. Cd to the root of your app directory and run this command and make sure lockit-mongodb-adapter is in your node modules directory.
npm install lockit-mongodb-adapter
Another thing you can do if you are certain it is installed is double check to see what is installed by running this command:
npm list
And this one to see what is installed globally:
npm list -g
Update:
I was able to reproduce the issue you where having. And to resolve it I deleted the module from the node moules directory. And re-installed with the following command:
npm install lockit-mongodb-adapter -save
It now shows up in npm list with no issues:

Resources