NPM安装打印机不工作



当我试图安装打印机(npm安装打印机)我得到这个错误。

C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: The Platform for project 'node_printer.vcxproj'
is invalid.  Platform='x64'. You may be seeing this message because you are try
ing to build a project without a solution file, and have specified a non-defaul
t Platform that doesn't exist for this project. [D:nodeprinternode_modulesp
rinterbuildnode_printer.vcxproj]

谁来帮我解决这个问题

先安装node-gyp

npm install -g node-gyp

然后安装在2.7.0到3.0.0之间的任何python版本

转到printer文件夹在node_modules和node-gyp中重建,如下所示

cd node_module/printer
node-gyp rebuild

答案就在错误本身:

C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: The Platform for project 'node_printer.vcxproj'
is invalid. Platform='x64'.

可能是该模块仅适用于x86 (x32) Windows安装。就我个人而言,我对此表示怀疑,但这可能是可能的。

同样,如上所述,安装python可以解决您的问题。(检查源代码,至少有一个.py文件)。重新安装node-gyp应该不会有任何区别,因为npm安装应该会处理它。

最新更新