Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How do I install mailparser module via npm on Windows 7 x64?

How do I install mailparser module via npm on Windows 7 x64?

Problem

Apologies if there is something obvious I'm missing, I've actually never encountered this error before using npm:

C:\work\spark3>npm install mailparser
npm http GET https://registry.npmjs.org/mailparser
npm http 304 https://registry.npmjs.org/mailparser
npm http GET https://registry.npmjs.org/encoding
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/mimelib
npm http GET https://registry.npmjs.org/iconv
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/mimelib
npm http 304 https://registry.npmjs.org/encoding
npm http 304 https://registry.npmjs.org/iconv
npm http GET https://registry.npmjs.org/iconv-lite/0.2.7
npm http GET https://registry.npmjs.org/addressparser
npm http 304 https://registry.npmjs.org/iconv-lite/0.2.7
npm http 304 https://registry.npmjs.org/addressparser

> [email protected] install C:\work\spark3\node_modules\mailparser\node_modules\iconv
> node-gyp rebuild


C:\work\spark3\node_modules\mailparser\node_modules\iconv>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack     at errnoException (child_process.js:975:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:766:34)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\work\spark3\node_modules\mailparser\node_modules\iconv
gyp ERR! node -v v0.10.4
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]
[email protected] node_modules\mailparser
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected])

I have tried the following on my Windows machine after scouring the web:

  • Reinstalling Node.js
  • Reinstalling Python 2.7
  • Ensuring the path for Python is set
  • Updating npm
  • Installing Visual C++ Express 2010
  • Installing node-gyp globally
Problem courtesy of: Mo Kargas

Solution

The problem is actually with the iconv module which, according to its GitHub page, "may or may not work with Windows".

Since mailparser declares it as an optional dependency, try downloading the mailparser source and remove iconv from package.json as a dependency.

Solution courtesy of: robertklep

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

How do I install mailparser module via npm on Windows 7 x64?

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×