node.lib : fatal error LNK1106: 文件无效或磁盘已满,问题报错

在node-gyp rebuild的时候报错

c:\users\administrator\appdata\roaming\npm\node_modules\sha3\src\addon.cpp(49):
 warning C4316: “SHA3Hash”: 在堆上分配的对象可能不是对齐 32 [C:\Users\Administ
rator\AppData\R
oaming\npm\node_modules\sha3\build\sha3.vcxproj]
c:\users\administrator\appdata\roaming\npm\node_modules\sha3\src\addon.cpp(83):
 warning C4996: 'v8::Object::Set': 被声明为已否决 [C:\Users\Administrator\AppDat
a\Roam
ing\npm\node_modules\sha3\build\sha3.vcxproj]
  c:\users\administrator\appdata\local\node-gyp\cache\12.13.0\include\node\v8.h
  (3402): note: 参见“v8::Object::Set”的声明
C:\\Users\\Administrator\\AppData\\Local\\node-gyp\\Cache\\12.13.0\\x64\\node.l
ib : fatal error LNK1106: 文件无效或磁盘已满: 无法查找到 0x2F20DC [C:\Users\Admi
nistrator\App
Data\Roaming\npm\node_modules\sha3\build\sha3.vcxproj]
gyp ERR! build error

 

环境:

windows7正确安装了node-gyp,排除了windows的问题

npm install --global --production windows-build-tools

参考https://blog.csdn.net/qq_33826977/article/details/78645665

删除了C:\Users\Administrator\AppData\Local\node-gyp目录,然后使用node-gyp rebuild命令下载新的node.lib

C:\Users\Administrator\AppData\Roaming\npm\node_modules\sha3>node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 2.7.17 found at "C:\Python27\python.ex
e"
gyp http GET https://nodejs.org/download/release/v12.13.0/node-v12.13.0-headers.
tar.gz
gyp http 200 https://nodejs.org/download/release/v12.13.0/node-v12.13.0-headers.
tar.gz
gyp http GET https://nodejs.org/download/release/v12.13.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v12.13.0/win-arm64/node.lib
gyp http GET https://nodejs.org/download/release/v12.13.0/win-x64/node.lib
gyp http GET https://nodejs.org/download/release/v12.13.0/win-x86/node.lib
gyp http 200 https://nodejs.org/download/release/v12.13.0/SHASUMS256.txt
gyp http 404 https://nodejs.org/download/release/v12.13.0/win-arm64/node.lib
gyp http 200 https://nodejs.org/download/release/v12.13.0/win-x86/node.lib
gyp http 200 https://nodejs.org/download/release/v12.13.0/win-x64/node.lib

然后就oK了。

c:\users\administrator\appdata\roaming\npm\node_modules\sha3\src\addon.cpp(49):
 warning C4316: “SHA3Hash”: 在堆上分配的对象可能不是对齐 32 [C:\Users\Administ
rator\AppData\R
oaming\npm\node_modules\sha3\build\sha3.vcxproj]
c:\users\administrator\appdata\roaming\npm\node_modules\sha3\src\addon.cpp(83):
 warning C4996: 'v8::Object::Set': 被声明为已否决 [C:\Users\Administrator\AppDat
a\Roam
ing\npm\node_modules\sha3\build\sha3.vcxproj]
  c:\users\administrator\appdata\local\node-gyp\cache\12.13.0\include\node\v8.h
  (3402): note: 参见“v8::Object::Set”的声明
    正在创建库 C:\Users\Administrator\AppData\Roaming\npm\node_modules\sha3\buil
d\Re
  lease\sha3.lib 和对象 C:\Users\Administrator\AppData\Roaming\npm\node_modules\
sh
  a3\build\Release\sha3.exp
  sha3.vcxproj -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\sha3\
  build\Release\\sha3.node
gyp info ok

你可能感兴趣的:(工具)