stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

Issue including lib in node (win11)

Open statts opened this issue 3 years ago • 3 comments

Whenever I try to include a library from Stdlib I get the following error: LINK : fatal error LNK1181: cannot open input file 'm.lib' [E:\Projects\vt\Customer_Web\vue-main\node_modules@stdlib\math-base-assert-is-negative-zero\build\addon.vcxproj]

This is working on other PCs and OSs so I'm not sure if it is a Win11 issue or something else but StackOverflow suggests removing the reference to the m.lib, though I don't think that is possible here?

statts avatar Nov 22 '21 10:11 statts

:tada: Welcome! :tada:

And thank you for opening your first issue! We will get back to you shortly. :runner: :dash:

github-actions[bot] avatar Nov 22 '21 10:11 github-actions[bot]

Thanks for filing this issue. After initial investigation, it seems that, for some reason, the build step of the included native addons fails for you on Windows 11. Ideally, the build step shouldn't run at all right now for the individual packages by default (and we have configured the package.json files as such), but it seems this is not followed by latest npm versions.

Temporary workarounds include:

  • Installing the packages from an older npm version (nvm is a good option to switch between Node.js and associated npm versions; the build scripts were not run for me after switching to an earlier Node.js version than 15)
  • Run the npm install command with the --ignore-scripts flag, which will ignore the build step, although it may undesirable in that it will ignore all scripts from other packages as well

We will follow-up on this issue thread once we have more updates to share.

Planeshifter avatar Nov 26 '21 16:11 Planeshifter

Thank-you for coming back on this issue, actually that is very helpful. Especially because I had other members my dev team try this and they had no issue, and also I had no issue when I tried on an older machine also running win 11 - it makes sense that it is npm version related as the pc with the issue is a new install which would have had latest NPM by default. I will use NVM and an older version of NPM for now as you say, and if you have an updated fix for latest npm in future that would be great as we may have a version requirement for other packages in future that may need latest npm.

thanks again

statts avatar Nov 26 '21 17:11 statts

@Planeshifter I believe we can close this out. Currently, we have "disabled" building native add-ons in published standalones.

kgryte avatar Nov 11 '23 10:11 kgryte