iconv 模块问题 nodejs

问题描述

我正在努力解决这个问题,要运行 node 应用程序,我得到 Error: Cannot find module 'iconv',我尝试使用 npm install iconv 命令安装 iconv,但出现以下错误。

gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use

然后尝试这个命令 - npm install --g --production windows-build-tools 并得到以下错误

npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated,see https://github.com/request/request/issues/3142
[                  ] / reify:resolve: timing reifyNode:node_modules/windows-build-tools/node_modules/ajv Completed in 7 

请帮我解决这个问题。

解决方法

因此,根据您提供的信息,我了解到这是 windows 中 node-gyp 的问题,因此有一些方法可以解决。

  1. npm install –no-optional 使用这个命令
  2. 尝试下载 windows-build-tools 软件包
  3. 手动下载 Visual Studio 2015 构建工具
  4. 告诉 Node 使用 2015 构建工具
  5. 确保您已安装 Python 2.7

我认为这会有所帮助

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...