0

I am attempting to run npm install to prepare a project to compile angular code, but I can't get it to work. I've tried various solutions I've found online, and nothing seems to work. Here's the relevant section from the log files:

...
npm ERR! gyp verb using MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\amd64\MSBuild.exe
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\amd64\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\amd64\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\[path1]\node_modules\node-gyp\lib\build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.18363
npm ERR! gyp ERR! command "C:\\[path2]\\nodejs\\node.exe" "C:\\[path1]\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\[path1]\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

node version gives me this, which might be helpful info:

{
  npm: '8.4.1',
  node: '16.13.2',
  v8: '9.4.146.24-node.14',
  uv: '1.42.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '93',
  nghttp2: '1.45.1',
  napi: '8',
  llhttp: '6.0.4',
  openssl: '1.1.1l+quic',
  cldr: '39.0',
  icu: '69.1',
  tz: '2021a',
  unicode: '13.0',
  ngtcp2: '0.1.0-DEV',
  nghttp3: '0.1.0-DEV'
}

My setup came from installing node-v16.13.2-x64.msi and letting it install Chocolatey to install the supporting software. It installed Python 3.10 and Visual Studio Build Tools 2019. However, it seems that npm install is asking for Python 2.7 (which I had to install manually).

I saw this question and attempted to install the suggested node-v11.14.0-x64.msi. After installing that and running npm install, I got errors about having an outdated version of node, so I reinstalled with version 16.13.2.

I have also tried pointing npm to use Visual Studio 2017 instead of 2019, but got the same error in my logs.

Is there anything else I could do to get past this annoying problem? Or a way to increase the debug that I'm getting back?

timbert
  • 1
  • 2
  • 1
    You are installing a module that contains a binary that must be compiled (`node-sass`). Usually this kind of error would be because of incompatibility between the Node version, `node-gyp` or something similar. Try to install it and build it manually. `node-gyp` has a `-v` option when building from the command line. – mmomtchev Feb 15 '22 at 00:52

0 Answers0