Skip to content

Commit 48d93ae

Browse files
authored
Add instructions on dealing with MSB4019
I saw this error when trying to install a project that depended on utf-8-validate: ``` {my-node-project-dir}\node_modules\bufferutil\build\bufferutil.vcxproj(20,3): error MSB4019: The imported project "C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. ``` Despite having followed all the instructions listed in this README, the `C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props` directory didn't exist (it should've been V140, which corresponds to VS 2015). The solution to this problem was at the bottom of [this issue filed against node-gyp](nodejs/node-gyp#671), and I thought it'd be useful if it was also highlighted here.
1 parent 10d93a8 commit 48d93ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

windows-environment.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ Here are a few packages you can try installing to see if your environment is set
102102
| **Inability to find msbuild, Visual Studio, or VC compiler** | VC compiler not installed, or environment not properly configured | <ul> <li>Install VC++ compiler</li> <li>Specify --msvs_version=2015 (or other VS version)</li> <li>npm config set msvs_version 2015 -g</li> </ul> |
103103
| **NaN/Node/v8/iojs-related syntax errors** | Package incompatible with current version of Node.js | <ul> <li>Upgrade to latest version of package + node.js, and see if issue still exists</li> <li>Search issues and/or file an issue on package repo</li> </ul> |
104104
| **Other syntax errors** | Incompatible with compiler version | <ul> <li>Upgrade to latest version of package + node.js, and see if issue still exists</li> <li>Search issues and/or file an issue on package repo</li> </ul> |
105-
| **Missing command or *.h file** | Configuration is probably fine, but missing other prerequisites | <ul> <li>Upgrade to latest version of package</li> <li>Check docs, try to install missing prerequisites, ensure they're accessible in PATH</li> <li>Search for header file or other pre-requisite that's missing, that may provide a clue where it's supposed to come from (e.g. Windows SDK not installed, OpenSSL, etc.)</li> <li>Search issues and/or file an issue on package repository</li> </ul> |
105+
| **Missing command or *.h file** | Configuration is probably fine, but missing other prerequisites | <ul> <li>Upgrade to latest version of package</li> <li>Check docs, try to install missing prerequisites, ensure they're accessible in PATH</li> <li>Search for header file or other pre-requisite that's missing, that may provide a clue where it's supposed to come from (e.g. Windows SDK not installed, OpenSSL, etc.)</li> <li>Search issues and/or file an issue on package repository</li> </ul>
106+
|
107+
| **MSB4019 error** | Older versions of Visual Studio or C++ Build tools already installed | <ul> <li>Add or modify the environment variable `VCTargetsPath` top point at the C++ build tools path. This should be something like `C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140` (where 140 corresponds to Visual Studio 2015)</li> <li>Search issues and/or file an issue on package repo</li> </ul> |
106108

107109
#### Deploying native modules
108110
Sometimes, when deploying a native module to production, oftentimes it is not possible to set up the production machine with all the required prerequisites to build the native Addon. Therefore, building locally or on a CI server and deploying `node_modules` may be the best option assuming there aren't any platform differences between the development and deployment machines.

0 commit comments

Comments
 (0)