Error MSB4062: The “SetEnv” task could not be loaded from the assembly

前端 未结 1 498
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-21 07:52

So I am trying to install a Node package called better-sqlite-pool, however I am stuck with an error which I can\'t seem to resolve. Whenever I run npm i better-sqlite-p

相关标签:
1条回答
  • 2021-01-21 08:22

    I have a rather similar issue, and got stock at the same point. I found two possible solutions over here:

    • install Visual Studio 2015 as well
    • create .config file in the same dir as your exe (if you don't have it already) containing binding redirection of msbuild assemblies

    The first option works for me:

    • use an administrator prompt from the current user, don't elevate from a limited user, the paths will be a mess if you do that
    • npm install --global --production --vs2015 windows-build-tools
    • npm install --global --production windows-build-tools (this one gets stuck during the installation, ctrl-c to end it)
    • npm install --global --production windows-build-tools (yes, the same command again to finish the configuration)
    • npm config set msvs_version 2015 --global

    Since I'm not a real programmer I wouldn't know where to begin for the latter option.

    0 讨论(0)
提交回复
热议问题