project-yuki / YUKI

YUKI Galgame Translator
GNU General Public License v3.0
1.51k stars 145 forks source link

yarn install 失败 #100

Closed zcoaolas closed 4 years ago

zcoaolas commented 4 years ago

拉了代码想在本地跑一下发现环境有问题。本人对electron其实不熟,只是出于好奇,有大佬能帮忙看一下的话非常感谢:)

yarn 用的是1.19.1版本,没看到readme里有说明,root cause?

node版本根据open issue已经控制到10.17.0 x86,npm试过6.0.16.14.3都不行

F:\YUKI_codetree\YUKI>npm config ls
; cli configs
metrics-registry = "https://registry.npm.taobao.org/"
scope = ""
user-agent = "npm/6.0.1 node/v10.17.0 win32 ia32"

; userconfig C:\Users\Administrator.jack-PC\.npmrc
chromedriver_cdnurl = "http://cdn.npm.taobao.org/dist/chromedriver"
node_gyp = "C:\\Users\\Administrator.jack-PC\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js"
registry = "https://registry.npm.taobao.org/"

; globalconfig C:\Users\Administrator.jack-PC\AppData\Roaming\npm\etc\npmrc
msvs_version = "2015"
python = "C:\\Users\\Administrator.jack-PC\\.windows-build-tools\\python27\\python.exe"

; builtin config undefined
prefix = "C:\\Users\\Administrator.jack-PC\\AppData\\Roaming\\npm"

; node bin location = C:\Program Files (x86)\nodejs\node.exe
; cwd = F:\YUKI_codetree\YUKI
; HOME = C:\Users\Administrator.jack-PC
; "npm config ls -l" to show all defaults.

yarn的error log在下面。这个错有点诡异,没有指向性,搜不到有用的solution

C:\\Users\\Administrator.jack-PC\\AppData\\Local\\node-gyp\\Cache\\iojs-1.4.2\\x64\\iojs.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0xF2ADE [F:\YUKI_codetree\YUKI\node_modules\electron-vibrancy\build\Vibrancy.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Administrator.jack-PC\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Administrator.jack-PC\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=1.4.2" "--arch=x64" "--debug" "--dist-url=https://atom.io/download/atom-shell"
gyp ERR! cwd F:\YUKI_codetree\YUKI\node_modules\electron-vibrancy
gyp ERR! node -v v10.17.0
gyp ERR! node-gyp -v v6.0.1
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron-vibrancy@0.1.3 rebuild: `node-gyp rebuild --target=1.4.2 --arch=x64 --debug --dist-url=https://atom.io/download/atom-shell`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-vibrancy@0.1.3 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

跟进去跑一下node-gyp rebuild --target=1.4.2 --arch=x64 --debug --dist-url=https://atom.io/download/atom-shell发现error可以稳定复现,看起来问题主要出在binding.gyp。所以是版本依赖问题或者project本身配置问题

gyp: binding.gyp not found (cwd: F:\YUKI_codetree\YUKI) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\Administrator.jack-PC\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Administrator.jack-PC\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=1.4.2" "--arch=x64" "--debug" "--dist-url=https://atom.io/download/atom-shelly"
gyp ERR! cwd F:\YUKI_codetree\YUKI
gyp ERR! node -v v10.17.0
gyp ERR! node-gyp -v v6.0.1
gyp ERR! not ok
luojunyuan commented 4 years ago

我也是经常在 https://atom.io/download/atom-shelly 这个位置出错,这个包似乎有一百多兆,我这边应该是网络问题他只会几十kb的给我下,不到一会儿就报timeout错误了。

我是直接使用windows-build-tool 一步安装,保证网络稳定直接 yarn 等他慢慢编译的。 我上传了一份编译好的 node_module提取码: xnq7,我不知道这管不管用,也许你可以尝试下载下来,清空 node_modules 文件夹将压缩包的文件解压进去?

zcoaolas commented 4 years ago

windows build tools之前装过。我先试一下覆盖node_module吧

另外你能报下依赖环境的版本吗?差的多的话很可能有问题

luojunyuan commented 4 years ago
PS C:\Users\> yarn --version
1.19.1
PS C:\Users\> npm --version
6.11.3
PS C:\Users\> node -v
v10.17.0
zcoaolas commented 4 years ago

node modules 替换后过了,的确是包的下载问题。感谢