The library 'libhostpolicy.dylib' required to execute the application.
See original GitHub issueHello,
When I installed https://www.npmjs.com/package/nswag, I receive this weird “The library ‘libhostpolicy.dylib’ required to execute the application was not found in ___”
NSwag NPM CLI
A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/xxx/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/'.
child_process.js:631
throw err;
^
Error: Command failed: dotnet "/Users/xxx/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/binaries/netcoreapp1.1/dotnet-nswag.dll" help --core 1.1
at checkExecSyncError (child_process.js:588:13)
at Object.execSync (child_process.js:628:13)
at Object.<anonymous> (/Users/xxx/.nvm/versions/node/v8.1.2/lib/node_modules/nswag/bin/nswag.js:37:11)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
I’ve tried a few things.
- Tried looking for the dynamic library online. Apparently a lot of people seem to have this issue with @dotnet/cli, A quick search in the issues seem that a lot of MacOS folks have similar issues. However I could not isolate the issue.
- Install different versions of the dotnet core.
- Trying to build the NSwag with build/*.bat but did not compile successfully.
Help would be greatly appreciated!
Dotnet info:
.NET Command Line Tools (2.1.0-preview1-006703)
Product Information:
Version: 2.1.0-preview1-006703
Commit SHA-1 hash: 512b568e33
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.0-preview1-006703/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0-preview3-25502-01
Build : bd3f818bad84f1296b4ee53f72ab8837b3caac98
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
A fatal error was encountered. The library 'libhostpolicy.so ...
The library 'libhostpolicy.dylib' required to execute the application was not found in '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/6.0 ...
Read more >Libhostpolicy.dylib missing - Meadow Development
The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/tpitman/Projects/Meadow/HelloWorld/HelloWorld/bin ...
Read more >Question about Dotnet for MacOS : r/learnprogramming
The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/aleksosaurus/Desktop/files/a lot of ...
Read more >Experienced an issue running .net 5 project on new m1
An error occurred while loading required library libhostpolicy.dylib from [/usr/local/share/dotnet/shared/Microsoft.NETCore.App/5.0.6].
Read more >A fatal error was encountered. The library 'libhostpolicy.so' ...
The library 'libhostpolicy.so' required to execute the application was not found in '/var/nop420/'. Failed to run as a self-contained app. If this should...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey I just encountered the same problem with the current npm package under Mac OS. Adding a
<OutputType>Exe</OutputType>
to the main PropertyGroup ofNSwag.ConsoleCore/NSwag.ConsoleCore.csproj
and rebuilding under Windows fixes the issue. It produces a valid NPM binary configuration by adding adotnet-nswag.runtimeconfig.json
to the publish directory. With that file present, the execution works fine.@RSuter A new release would be appreciated. 😃
Please test with NPM package v11.3.4