Build fails on Windows on ARM; Win32 arm64
- [x] I have read the documentation relating to installation.
- [x] I have ensured that the architecture and platform of Node.js used for
npm installis the same as the architecture and platform of Node.js used at runtime.
Are you using the latest version of sharp?
- [x] I am using the latest version of
sharpas reported bynpm view sharp dist-tags.latest.
What is the complete output of running npm install --verbose --foreground-scripts sharp in an empty directory?
2023-03-17T17_37_37_241Z-debug-0.log
What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?
System: OS: Windows 10 10.0.22621 CPU: (8) arm64 Microsoft SQ1 @ 3.0 GHz Memory: 871.60 MB / 15.47 GB Binaries: Node: 18.11.0 - C:\Program Files\node\default\node.EXE Yarn: 1.22.19 - C:\Program Files\node\default\yarn.CMD npm: 8.19.2 - C:\Program Files\node\default\npm.CMD
A search for the "cannot open input file Delayimp.lib" error message suggests this might be a Visual Studio misconfiguration/corruption e.g. https://stackoverflow.com/questions/26410604/cannot-open-input-file-delayimp-lib
Looks like the error is with nothing.vcxproj (though that would make it an issue in the node-addon-api package). Can someone confirm and I can take the issue over there?
It's creating a node_modules\sharp\node-addon-api\nothing.vcxproj file with an incorrect build target. My machine has Delayimp.lib for all three arches (arm64, x86, x64) but I'm using an arm64 build of node (which would prevent an x86 lib from loading).
Unless there is a configuration param to specify the architecture when using node-addon-api?
The npm_config_arch setting (e.g. via the npm --arch flag) controls which architecture is passed to node-gyp and therefore used at compile time.
IIRC the Visual Studio link.exe doesn't allow control over architecture but instead assumes that of the first binary it sees.
I'm unsure where the problem lies here, and don't have access to a ARM64 Windows environment to reproduce.
@jonshipmansmc Were you able to make any progress with this?
Sorry no, I've been too busy as of late
Closing due to inactivity but please feel free to reopen if/when further help is required.
problem here is the Sharp, i have the same problem in the Mac due to Arm, can't run Strapi here due to it. Using latest versions of Node, if not mistaken only works in the Node 14.
@bgomes-bacardi If you're still having problems, please open a new installation issue and answer all of the questions. https://github.com/lovell/sharp/issues/new?assignees=&labels=installation&projects=&template=installation.md