Npm install build failed

Asked by At

I've installed node-sass v4.12.0 but when I do an npm i, it uses the 4.9.4 for some reason. I don't know where it gets de 4.9.4 from, because in my package.json I use the 4.12.0.

My node-version: 12.3.1

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\OneHipFrontend\Development\Code\Client\OneHip.Web\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\OneHipFrontend\\Development\\Code\\Client\\OneHip.Web\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags="
"--libsass_library="
gyp ERR! cwd C:\OneHipFrontend\Development\Code\Client\OneHip.Web\node_modules\@angular-devkit\build-angular\node_modules\node-sass
gyp ERR! node -v v12.3.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

npm ERR! code ELIFECYCLE
npm ERR! errno 1
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.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

c:\onehipfrontend\development\code\client\onehip.web\node_modules\@angular-devkit\build-angular\node_modules\node-sass\src\create_string.cpp(17): error C2664: 'v8::String::Utf8Value::Utf8Value(const v8::String::Utf8Value &)': cannot convert argument 1 from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value &' [C:\OneHipFrontend\Development\Code\Client\OneHip.Web\node_modules\@angular-devkit\build-angular\node_modules\node-sass\build\binding.vcxproj]

c:\OneHipFrontend\Development\Code\Client\OneHip.Web\node_modules\@angular-devkit\build-angular\node_modules\node-sass\build\binding.sln" (default target) (1) -> c:\OneHipFrontend\Development\Code\Client\OneHip.Web\node_modules\@angular-devkit\build-angular\node_modules\node-sass\build\binding.vcxproj.metaproj" (default target) (2) ->c:\OneHipFrontend\Development\Code\Client\OneHip.Web\node_modules\@angular-devkit\build-angular\node_modules\node-sass\build\binding.vcxproj" (default target) (4) -> (ClCompile target) ->   c:\onehipfrontend\development\code\client\onehip.web\node_modules\@angular-devkit\build-angular\node_modules\node-sass\src\create_string.cpp(17): error C2664: 'v8::String::Utf8Value::Utf8Value(const v8::String::Utf8Value &)': cannot convert argument 1 from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value &' [C:\OneHipFrontend\Development\Code\Client\OneHip.Web\node_modules\@angular-devkit\build-angular\node_modules\node-sass\build\binding.vcxproj]

Things I've tried:

  • Clear the cache
  • Deleted the node-modules
  • Deleted package-lock
  • Already tried an npm rebuild node-sass
  • Start the project in a new folder.

Nothing worked so far

1 Answers

0
nschonni On

From the folder, it looks like the old version is a dependency from https://www.npmjs.com/package/@angular-devkit/build-angular, but I don't see an explicit mention of node-sass in the dependencies. If the sub-dependency is pinned to node-sass 4.9.4, the highest version of Node that will be compatible is Node 10 https://github.com/sass/node-sass#supported-nodejs-versions-vary-by-release-please-consult-the-releases-page-below-is-a-quick-guide-for-minimium-support