3

I am trying to connect Node.js with MariaDB. Its throwing error while installing the mariasql package using npm.

 npm install mariasql

Error

TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\xyz\Desktop\rtrt\am2\node_modules\mariasql\build\deps\libmariadbclient\zlib\zlib.vcxproj]

Note:

Windows 7

Node.js - 0.10.24

Community
  • 1
  • 1
HomeWork
  • 263
  • 1
  • 4
  • 14

2 Answers2

1

You will need Visual C++ (not sure which version) to download and build this module. Infact, for most npm modules which aren't pure JS modules, it is recommended to use a linux machine for development and deployment, since most of those modules are written to be built on linux build tools, and work as expected in the linux environment.

Munim
  • 6,310
  • 2
  • 35
  • 44
  • 2
    Recommended by whom? While there are a handful of modules that don't work well on Windows natively, it's the minority. Windows works fine for most NodeJs development needs. – WiredPrairie Dec 23 '13 at 12:48
  • 2
    @WiredPrairie Those handful of modules are actually some of the most important ones, especially for the person who asked the question (I work with him). I should have probably added that context. Also, the deployment environment is more often that not a Linux box, and it's best to develop in the same environment, in case you write some code which isn't portable (if you write some filesystem code, you have to be extra careful). I see questions on SO regarding windows and node.js issues every day. I honestly think its best to just work on Linux. – Munim Dec 23 '13 at 12:54
  • 1
    I follow the NodeJs tag on Stack overflow and don't see all of these issues that you're seeing. Often, it's a missing install of Python or Visual Studio Express isn't installed. – WiredPrairie Dec 23 '13 at 12:58
  • `mariasql` compiled without issue on my Windows dev machine. So, your claim is still unproven. Of course, it's important to test with the final production environment before putting new code into production. And I disagree that it's just "best to work on Linux." :) – WiredPrairie Dec 23 '13 at 14:39
  • @WiredPrairie fair enough. we have to agree to disagree on this point. – Munim Dec 24 '13 at 05:11
  • @WiredPrairie FYI: Simple basic issues with file management like this: http://stackoverflow.com/questions/20796902/deleting-file-in-node-js – Munim Dec 27 '13 at 11:23
  • I thought you were done with this? Operating systems behave differently when it comes to file deletion. So? – WiredPrairie Dec 27 '13 at 13:53
0

This error occurs because CL.EXE cannot be found. CL is a Microsoft compiler/linker for C/C++. Based on the path you provided, MariaSQL is pointing to a vcxproj file for zlib. A vcxproj is a Visual Studio C/C++ project file, and zlib is a compression library. Based on the file paths, it looks like NPM is attempting to build zlib which seems unnecessary, but this problem occurs because you either do not have Visual Studio installed, the path is incorrect, or you don't need to build zlib. My suggestion would be to add the "--production" flag when calling NPM so that development-only dependencies are not installed. That will not work however since MariaSQL does not declare devDependencies. It appears that you need to install Visual Studio or configure your paths correctly.