tojocky / node-printer

Native node.js printer
1.53k stars 441 forks source link

Failed build in windows #242

Open voxsoftware opened 5 years ago

voxsoftware commented 5 years ago

System: Windows server 2019 x64 Electron 4.0.4 Vstools 2017 printer@0.2.2

The error is for 0.2.2. Version 0.2.1 is compiling good.

C:\Users\Administrator\node_modules\printer>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. C:\Users\Administrator\node_modules\printer\build\node_printer.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:189:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Administrator\node_modules\printer gyp ERR! node -v v10.15.1 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Administrator\package.json' npm WARN Administrator No description npm WARN Administrator No repository field. npm WARN Administrator No README data npm WARN Administrator No license field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! printer@0.2.2 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the printer@0.2.2 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2019-02-08T08_18_11_432Z-debug.log

mtamma commented 5 years ago

i face the same issue

$ npm install printer --msvs_version=2013

printer@0.2.2 install d:\SourceCode\Public\printing-in-node\node_modules\printer node-gyp rebuild

d:\SourceCode\Public\printing-in-node\node_modules\printer>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. d:\SourceCode\Public\printing-in-node\node_modules\printer\build\node_printer.vcxproj(20,3): error MSB4019: The imported project "d:\Mic rosoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd d:\SourceCode\Public\printing-in-node\node_modules\printer gyp ERR! node -v v8.9.4 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok npm WARN printing-in-node@1.0.0 No repository field.`

any help really appreciate it.

mtamma commented 5 years ago

just get the solution. from another post. I need to install windows-build-tools before running that installation.

npm install windows-build-tools -g

Thanks