Code Monkey home page Code Monkey logo

Comments (19)

sourcedelica avatar sourcedelica commented on June 12, 2024 1

Both Windows and Node are outside of my usual domain so my understanding is somewhat limited, otherwise I might have some better feedback. Looking at the docs I don't see msbuild_path - I must have gotten that from googling around after I ran into the Add-Path error. I'm not sure if that should be documented or not.

Another datapoint I have is on this part of the README:

It's advised to install following Powershell module: [VSSetup](https://github.com/microsoft/vssetup.powershell) using 
Install-Module VSSetup -Scope CurrentUser. This will make Visual Studio detection logic to use more flexible and 
accessible method, avoiding Powershell's ConstrainedLanguage mode.

It worked for me without installing VSSetup.

On a different topic:

Should I submit a PR to add -IgnoreWarnings to the Add-Type call in find-visualstudio.js? It's not the best fix in the world. It would be better to not ignore warnings and solve what seems to be the core problem: Invalid search path 'lib\\um\\x64' specified in 'LIB environment variable'. But on the other hand I don't want to be patching node-gyp indefinitely, stuck on version 10.0.1 :)

from node-gyp.

cclauss avatar cclauss commented on June 12, 2024

Please provide the command typed and the full error log.

from node-gyp.

sourcedelica avatar sourcedelica commented on June 12, 2024

Do you mean the part under Verbose output (from npm or node-gyp) that starts with node-pre-gyp install --fallback-to-build -j max --loglevel silly?

from node-gyp.

sourcedelica avatar sourcedelica commented on June 12, 2024

I also added the npm debug log but there's not much there.

from node-gyp.

sourcedelica avatar sourcedelica commented on June 12, 2024

One other data point. I'm in the process of configuring a set of CI build machines, adding four more to an existing set of four. The CI job that I'm testing on the new machines is the one that's failing with this error. The job runs ok on the original build machines. The interesting thing is that on the original machines there is no .npmrc with msvs_version or msbuild_path. It looks like Find-VisualStudio.cs can find VS even without these config vars set.

from node-gyp.

cclauss avatar cclauss commented on June 12, 2024

Is the version of npm identical on all machines?

from node-gyp.

sourcedelica avatar sourcedelica commented on June 12, 2024

Yes - npm 10.2.3

from node-gyp.

cclauss avatar cclauss commented on June 12, 2024

The URL above points to some commands that should prove that those config vars are no longer valid on modern npm.

  • #2959 should improve findVisualStudio

from node-gyp.

sourcedelica avatar sourcedelica commented on June 12, 2024

Ahh - That explains why when I tried using npm config to add them it wouldn't let me. I had to edit .npmrc to put them in. :)

from node-gyp.

cclauss avatar cclauss commented on June 12, 2024

If you set them in .npmrc and then do npm config list, do they appear in the active settings?

from node-gyp.

sourcedelica avatar sourcedelica commented on June 12, 2024

Yes:

$ npm config list
; "user" config from C:\Users\svc_platform\.npmrc

msbuild_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\MSBuild.exe"
msvs_version = "2019"

; node bin location = C:\Program Files\nodejs\node.exe
; node version = v18.19.0
; npm local prefix = C:\Users\svc_platform\ericp\llm-core
; npm version = 10.2.3
; cwd = C:\Users\svc_platform\ericp\llm-core
; HOME = C:\Users\svc_platform
; Run `npm config ls -l` to show all defaults.

from node-gyp.

sourcedelica avatar sourcedelica commented on June 12, 2024

I found a fix. Adding -IgnoreWarnings to the Add-Type call in find-visualstudio.js fixes the problem, though editing the node-gyp source code is not my preferred solution :).

I'm not sure where the LIB environment variable is coming from. It's not set at the system or user level for the user I'm using.

from node-gyp.

sourcedelica avatar sourcedelica commented on June 12, 2024

This fix also works if I remove the msvs_version and msbuild_path settings from ~/.npmrc.

from node-gyp.

cclauss avatar cclauss commented on June 12, 2024

Do you have any comments or suggestions for our docs or #2959?

from node-gyp.

Benjamin51380 avatar Benjamin51380 commented on June 12, 2024

Also facing this one.
@sourcedelica solution solves the issue but I totally agree with them on the relevance of this type of fix. I've also investigated on my side about the source of this 'lib\\um\\x64' path without success for the moment.

from node-gyp.

cclauss avatar cclauss commented on June 12, 2024

@sourcedelica Can this be closed?

from node-gyp.

sourcedelica avatar sourcedelica commented on June 12, 2024

Could you clarify what you were asking - either, can this issue (#2981) be closed, or the one you linked (mapbox/node-pre-gyp#657) be closed?

I can't comment on the second issue but the original problem (this issue, #2981) is still a problem - we're still patching find-visualstudio.js after installation. Unless there's a workaround that I missed it should stay open to indicate that it's still a problem.

from node-gyp.

cclauss avatar cclauss commented on June 12, 2024

I was asking if this issue be closed.

Can you replicate this problem without using node-pre-gyp which is no longer maintained?

mapbox/node-pre-gyp#712 demonstrates that support in lib/util/abi_crosswalk.json currently stops at Node.js v17.

from node-gyp.

cclauss avatar cclauss commented on June 12, 2024

To make node-pre-gyp support Node.js > v17 you can try:

npm ci  # node-pre-gyp
npm run update-crosswalk

from node-gyp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.