0
votes

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
1
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.robertklep
Ahh I see, wasn't sure if it was a problem with iconv or node-gyp. I'll give that a shot - thanks robertMo Kargas
Robert, do you want to add this as an answer so I can accept it?Mo Kargas

1 Answers

1
votes

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.