node-sass compilation fails because Microsoft.Cpp.Default.props was not found

Created on 8 Sep 2016  路  2Comments  路  Source: sass/node-sass

Windows 7 with Visual Studio 2013
I'm using node 6.5.0

The critical line seems to be this one:
H:\workspace\CMOTStyles\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: The imported project "H:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Full log:

H:\workspace\CMOTStyles>npm install node-sass --msvs_version=2013
npm WARN prefer global [email protected] should be installed with -g

> [email protected] install H:\workspace\CMOTStyles\node_modules\node-sass
> node scripts/install.js

Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.9.3/win32-x64-48_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.9.3/win32-x64-48_binding.node":

getaddrinfo ENOTFOUND github.com github.com:443

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> [email protected] postinstall H:\workspace\CMOTStyles\node_modules\node-sass
> node scripts/build.js

Building: C:\apps\nodejs\node.exe H:\workspace\CMOTStyles\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\apps\\nodejs\\node.exe',
gyp verb cli   'H:\\workspace\\CMOTStyles\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (H:\workspace\CMOTStyles\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (H:\workspace\CMOTStyles\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (H:\workspace\CMOTStyles\node_modules\which\which.js:81:29)
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\which\which.js:90:16
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (H:\workspace\CMOTStyles\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (H:\workspace\CMOTStyles\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (H:\workspace\CMOTStyles\node_modules\which\which.js:81:29)
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\which\which.js:90:16
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (H:\workspace\CMOTStyles\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (H:\workspace\CMOTStyles\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (H:\workspace\CMOTStyles\node_modules\which\which.js:81:29)
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\which\which.js:90:16
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed  python { Error: not found: python
gyp verb `which` failed     at getNotFoundError (H:\workspace\CMOTStyles\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (H:\workspace\CMOTStyles\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (H:\workspace\CMOTStyles\node_modules\which\which.js:81:29)
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\which\which.js:90:16
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at H:\workspace\CMOTStyles\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb check python launcher python executable found: "C:\\Python27\\python.exe"
gyp verb check python version `C:\Python27\python.exe -c "import platform; print(platform.python_version());"` returned: "2.7.10\r\n"
gyp verb get node dir compiling against specified --nodedir dev files: C:\apps\nodejs_src
gyp verb build dir attempting to create "build" dir: H:\workspace\CMOTStyles\node_modules\node-sass\build
gyp verb build dir "build" dir needed to be created? H:\workspace\CMOTStyles\node_modules\node-sass\build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: H:\workspace\CMOTStyles\node_modules\node-sass\build\config.gypi
gyp verb config.gypi checking for gypi file: H:\workspace\CMOTStyles\node_modules\node-sass\config.gypi
gyp verb common.gypi checking for gypi file: H:\workspace\CMOTStyles\node_modules\node-sass\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'H:\\workspace\\CMOTStyles\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2013',
gyp info spawn args   '-I',
gyp info spawn args   'H:\\workspace\\CMOTStyles\\node_modules\\node-sass\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'H:\\workspace\\CMOTStyles\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\apps\\nodejs_src\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\apps\\nodejs_src',
gyp info spawn args   '-Dnode_gyp_dir=H:\\workspace\\CMOTStyles\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=H:\\workspace\\CMOTStyles\\node_modules\\node-sass',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'H:\\workspace\\CMOTStyles\\node_modules\\node-sass\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\apps\nodejs_src
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe" in PATH - finding location in registry
gyp info spawn C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 9/8/2016 11:05:41 AM.
Project "H:\workspace\CMOTStyles\node_modules\node-sass\build\binding.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|x64".
Project "H:\workspace\CMOTStyles\node_modules\node-sass\build\binding.sln" (1) is building "H:\workspace\CMOTStyles\node_modules\node-sass\build\binding.vcxproj.metaproj" (2) on node 1 (default targets).
Project "H:\workspace\CMOTStyles\node_modules\node-sass\build\binding.vcxproj.metaproj" (2) is building "H:\workspace\CMOTStyles\node_modules\node-sass\build\src\libsass.vcxproj" (3) on node 1 (default targets).
H:\workspace\CMOTStyles\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: The imported project "H:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "H:\workspace\CMOTStyles\node_modules\node-sass\build\src\libsass.vcxproj" (default targets) -- FAILED.

Done Building Project "H:\workspace\CMOTStyles\node_modules\node-sass\build\binding.vcxproj.metaproj" (default targets) -- FAILED.

Done Building Project "H:\workspace\CMOTStyles\node_modules\node-sass\build\binding.sln" (default targets) -- FAILED.


Build FAILED.

"H:\workspace\CMOTStyles\node_modules\node-sass\build\binding.sln" (default target) (1) ->
"H:\workspace\CMOTStyles\node_modules\node-sass\build\binding.vcxproj.metaproj" (default target) (2) ->
"H:\workspace\CMOTStyles\node_modules\node-sass\build\src\libsass.vcxproj" (default target) (3) ->
  H:\workspace\CMOTStyles\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: The imported project "H:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk
.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.43
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (H:\workspace\CMOTStyles\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\apps\\nodejs\\node.exe" "H:\\workspace\\CMOTStyles\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd H:\workspace\CMOTStyles\node_modules\node-sass
gyp ERR! node -v v6.5.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
Build failed
[email protected] H:\workspace\CMOTStyles
`-- [email protected]  extraneous

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\apps\\nodejs\\node.exe" "C:\\Users\\NBKA0O5\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-sass" "--msvs_version=2013"
npm ERR! node v6.5.0
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     H:\workspace\CMOTStyles\npm-debug.log

H:\workspace\CMOTStyles>[
Awaiting Response Node 6 OS - Windows npm build

Most helpful comment

Do you "select Common Tools for Visual C++ during setup" from https://github.com/nodejs/node-gyp#installation

All 2 comments

Do you "select Common Tools for Visual C++ during setup" from https://github.com/nodejs/node-gyp#installation

You need to add "VCTargetsPath" to your path.
My path was"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets"

Was this page helpful?
0 / 5 - 0 ratings