0

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

> iconv@2.0.4 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 iconv@2.0.4
mailparser@0.3.4 node_modules\mailparser
├── mime@1.2.9
├── mimelib@0.2.12 (addressparser@0.1.3)
└── encoding@0.1.6 (iconv-lite@0.2.7)

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
4

1 回答 1

1

问题实际上出在 iconv 模块上,根据其 GitHub 页面,该模块“可能适用于 Windows,也可能不适用于 Windows”。

由于 mailparser 将其声明为可选依赖项,因此请尝试下载 mailparser 源并将 iconvpackage.json作为依赖项从中删除。

于 2013-04-19T06:00:36.580 回答