npm install fails with error C2373 with vs2015 update 3

后端 未结 3 1606
花落未央
花落未央 2021-01-30 01:35

After reinstalling my machine with windows 10, setting it up with Visual Studio 2015 I encountered this error on installing my git repositories:

npm

相关标签:
3条回答
  • 2021-01-30 02:10

    Or update npm:

    npm install npm -g
    
    0 讨论(0)
  • 2021-01-30 02:15

    This error stays in relation with npm, node-gyp and Visual Studio 2015 and is already fixed in node-gyp@3.4.0, but npm is still pointing to an old version. As I workaround I can propose this:

    1. Go to your folder where npm is installed, e.g.: C:\Program Files\nodejs\node_modules\npm

    2. Open: package.json

    3. Remove entry for node-gyp in bundleDependencies

    4. Bump version number to 3.4.0 for node-gyp in dependencies

    5. Make a npm i in this directory to install node-gyp@3.4.0 to fix the problem

    Relating GitHub issues can be found here:

    1. nodejs/node#7286
    2. nodejs/node-gyp#956
    3. npm/npm#13199
    4. npm/npm#13200
    0 讨论(0)
  • 2021-01-30 02:23

    An alternative solution that doesn't involve messing with npm installation is to run

    SET CL=-DDELAYIMP_INSECURE_WRITABLE_HOOKS %CL%
    

    before running npm install

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