Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed #32

Open
unbadfish opened this issue Jan 5, 2021 · 22 comments
Open

Build failed #32

unbadfish opened this issue Jan 5, 2021 · 22 comments

Comments

@unbadfish
Copy link

unbadfish commented Jan 5, 2021

克隆仓库之后在 git bash 的窗口中执行以下操作

Administrator@PC--20180114RUC MINGW64 /f/Script
$ cd lrc-maker

Administrator@PC--20180114RUC MINGW64 /f/Script/lrc-maker (master)
$ npm i

> [email protected] postinstall F:\Script\lrc-maker\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 945 packages from 456 contributors and audited 948 packages in 503.879s

118 packages are looking for funding
  run `npm fund` for details

found 1 low severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

Administrator@PC--20180114RUC MINGW64 /f/Script/lrc-maker (master)
$ npm audit fix
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

up to date in 5s

118 packages are looking for funding
  run `npm fund` for details

fixed 0 of 1 vulnerability in 948 scanned packages
  1 vulnerability required manual review and could not be updated

Administrator@PC--20180114RUC MINGW64 /f/Script/lrc-maker (master)
$ npm audit

                       === npm audit security report ===


                                 Manual Review
             Some vulnerabilities require your attention to resolve

          Visit https://go.npm.me/audit-guide for additional guidance


  Low             Prototype Pollution

  Package         yargs-parser

  Patched in      >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2

  Dependency of   stylelint-config-rational-order [dev]

  Path            stylelint-config-rational-order > stylelint > meow >
                  yargs-parser

  More info       https://npmjs.com/advisories/1500

found 1 low severity vulnerability in 948 scanned packages
  1 vulnerability requires manual review. See the full report for details.

Administrator@PC--20180114RUC MINGW64 /f/Script/lrc-maker (master)
$ npm run build

> [email protected] build F:\Script\lrc-maker
> make build

mkdir -p build
cp -r assets/* build
mkdir -p build/lib
rsync -am --no-links --exclude 'node_modules' node_modules/react node_modules/react-dom build/lib
Makefile:35: recipe for target 'build/lib' failed
process_begin: CreateProcess(NULL, rsync -am --no-links --exclude node_modules node_modules/react node_modules/react-dom build/lib, ...) failed.
make (e=2): 系统找不到指定的文件。
make: *** [build/lib] Error 2
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `make build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-01-05T14_22_42_829Z-debug.log

Administrator@PC--20180114RUC MINGW64 /f/Script/lrc-maker (master)
$ npm start

> [email protected] start F:\Script\lrc-maker
> make dev

node_modules/.bin/ts-node -P scripts/tsconfig.json scripts/generate.metadata.ts | tee src/metadata.d.ts > worker/metadata.d.ts
node_modules/.bin/tsc -b
'node_modules' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Makefile:51: recipe for target 'build/components/app.context.js' failed
make: *** [build/components/app.context.js] Error 1
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] start: `make dev`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-01-05T14_24_20_852Z-debug.log

Administrator@PC--20180114RUC MINGW64 /f/Script/lrc-maker (master)
$

C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-01-05T14_22_42_829Z-debug.log:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'E:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: E:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;F:\Script\lrc-maker\node_modules\.bin;C:\Users\Administrator\bin;E:\Program Files\Git\mingw64\bin;E:\Program Files\Git\usr\local\bin;E:\Program Files\Git\usr\bin;E:\Program Files\Git\usr\bin;E:\Program Files\Git\mingw64\bin;E:\Program Files\Git\usr\bin;C:\Users\Administrator\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies;C:\Program Files (x86)\税务证书应用客户端;C:\Users;Administrator\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32;C:\Users\Administrator\go\bin;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32;C:\Users\Administrator\go\bin;E:\Program Files\ffmpeg\bin;E:\Program Files\mpv;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32;F:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\bin;E:\Program Files\Pandoc;E:\Program Files\nodejs;E:\Program Files\Git\cmd;C:\Program Files\dotnet;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32;E:\Program Files\JetBrains\PyCharm Community Edition\bin;C:\Users\Administrator\AppData\Roaming\npm;E:\Program Files\Bandizip;E:\Program Files\Microsoft VS Code\bin;C:\MinGW\bin;C:\Users\Administrator\AppData\Local\Programs\Python\Python38\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38;E:\Program Files\JetBrains\PyCharm Community Edition\bin;C:\Users\Administrator\AppData\Roaming\npm;E:\Program Files\Bandizip;E:\Program Files\Git\usr\bin\vendor_perl;E:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle [email protected]~build: CWD: F:\Script\lrc-maker
10 silly lifecycle [email protected]~build: Args: [ '/d /s /c', 'make build' ]
11 silly lifecycle [email protected]~build: Returned: code: 2  signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: `make build`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (E:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (E:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd F:\Script\lrc-maker
16 verbose Windows_NT 6.1.7601
17 verbose argv "E:\\Program Files\\nodejs\\node.exe" "E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v12.18.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] build: `make build`
22 error Exit status 2
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-01-05T14_24_20_852Z-debug.log:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'E:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: E:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;F:\Script\lrc-maker\node_modules\.bin;C:\Users\Administrator\bin;E:\Program Files\Git\mingw64\bin;E:\Program Files\Git\usr\local\bin;E:\Program Files\Git\usr\bin;E:\Program Files\Git\usr\bin;E:\Program Files\Git\mingw64\bin;E:\Program Files\Git\usr\bin;C:\Users\Administrator\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies;C:\Program Files (x86)\税务证书应用客户端;C:\Users;Administrator\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32;C:\Users\Administrator\go\bin;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32;C:\Users\Administrator\go\bin;E:\Program Files\ffmpeg\bin;E:\Program Files\mpv;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32;F:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\bin;E:\Program Files\Pandoc;E:\Program Files\nodejs;E:\Program Files\Git\cmd;C:\Program Files\dotnet;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32;E:\Program Files\JetBrains\PyCharm Community Edition\bin;C:\Users\Administrator\AppData\Roaming\npm;E:\Program Files\Bandizip;E:\Program Files\Microsoft VS Code\bin;C:\MinGW\bin;C:\Users\Administrator\AppData\Local\Programs\Python\Python38\Scripts;C:\Users\Administrator\AppData\Local\Programs\Python\Python38;E:\Program Files\JetBrains\PyCharm Community Edition\bin;C:\Users\Administrator\AppData\Roaming\npm;E:\Program Files\Bandizip;E:\Program Files\Git\usr\bin\vendor_perl;E:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle [email protected]~start: CWD: F:\Script\lrc-maker
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'make dev' ]
11 silly lifecycle [email protected]~start: Returned: code: 2  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `make dev`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (E:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (E:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd F:\Script\lrc-maker
16 verbose Windows_NT 6.1.7601
17 verbose argv "E:\\Program Files\\nodejs\\node.exe" "E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.18.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] start: `make dev`
22 error Exit status 2
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

make:

C:\Users\Administrator>make -v
GNU Make 3.82.90
Built for i686-pc-mingw32
Copyright (C) 1988-2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@magic-akari
Copy link
Owner

magic-akari commented Jan 7, 2021

这是什么终端环境? WSL?

@pzhlkj6612
Copy link
Contributor

看输出的错误:

process_begin: CreateProcess(NULL, rsync -am --no-links --exclude node_modules node_modules/react node_modules/react-dom build/lib, ...) failed.
make (e=2): 系统找不到指定的文件。
make: *** [build/lib] Error 2

说的是找不到 rsync ,所以在这个目标挂掉了:

lrc-maker/Makefile

Lines 34 to 38 in c4c249f

$(target_lib): $(lib) $(package_json)
mkdir -p build/lib
rsync -am --no-links --exclude 'node_modules' node_modules/react node_modules/react-dom build/lib
touch build/lib

@unbadfish 你试试 Base Package_ rsync - MSYS2 Packages

@unbadfish
Copy link
Author

这是什么终端环境? WSL?

@magic-akari cmd...
我是windows 😢

@pzhlkj6612
Copy link
Contributor

pzhlkj6612 commented Jan 10, 2021

@unbadfish 我认为你这是在使用 Mintty 的终端,连上 MSYS2 的环境,使用 MinGW64 (mingw-w64) 的那套工具,而不是 cmd 。你可以从提示符MINGW64或右侧的路径格式直接看出来。


cmd 的提示符长这样:

C:\Users\foo>ver

Microsoft Windows [Version 10.0.19042.685]

@pzhlkj6612
Copy link
Contributor

@unbadfish 实际上你在第一句就已经说了:

克隆仓库之后在 git bash 的窗口中执行以下操作

所以这是 Git Bash 的那个环境,也是 MSYS2 。不过,相较于完整的 MSYS2 环境, Git Bash 少了一些预装的程序,例如包管理器 pacman ,毕竟 Git Bash 只是用来 Git 的。

我找到一个不是很新的、关于在 Git Bash 安装 rsync 的教程,你可以看一下: windows - How to add more commands to Git Bash? - Super User § answer-1464552


你可以使用uname -a命令查看你所在的环境:

foo@bar MINGW64 ~
$ uname -a
MINGW64_NT-10.0-19042 BAZ 3.1.7-340.x86_64 2020-10-23 13:08 UTC x86_64 Msys

@unbadfish
Copy link
Author

unbadfish commented Jan 10, 2021

我安装了msys,rsync,用PATH调用,但是还是失败:cry:
这回用的是vscode

F:\Script\lrc-maker>npm run build
Debugger attached.

> [email protected] build F:\Script\lrc-maker
> make build

FIND: 参数格式不正确
FIND: 参数格式不正确
FIND: 参数格式不正确
找不到文件 - *.css
找不到文件 - *.ts
找不到文件 - *.ts
找不到文件 - *.ts
找不到文件 - *.ts
找不到文件 - *.ts
FIND: 参数格式不正确
找不到文件 - *.ts
FIND: 参数格式不正确
找不到文件 - *.ts
找不到文件 - *.ts
FIND: 参数格式不正确
找不到文件 - *.ts
找不到文件 - *.ts
FIND: 参数格式不正确
找不到文件 - *.ts
找不到文件 - *.ts
FIND: 参数格式不正确
找不到文件 - *.ts
找不到文件 - *.ts
FIND: 参数格式不正确
找不到文件 - *.ts
找不到文件 - *.ts
node_modules/.bin/tsc -b tsconfig.es6.json
FIND: 参数格式不正确
'node_modules' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Makefile:59: recipe for target 'build/index.es6.js' failed
make: *** [build/index.es6.js] Error 1
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `make build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-01-10T02_04_46_966Z-debug.log
Waiting for the debugger to disconnect...

F:\Script\lrc-maker>rsync -V
rsync  version 3.2.3  protocol version 31
Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, no hardlink-specials, symlinks, IPv6, atimes,
    batchfiles, inplace, append, ACLs, xattrs, optional protect-args, iconv,
    symtimes, prealloc, stop-at, no crtimes
Optimizations:
    no SIMD, asm, openssl-crypto
Checksum list:
    xxh128 xxh3 xxh64 (xxhash) md5 md4 none
Compress list:
    zstd lz4 zlibx zlib none

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-01-10T02_04_46_966Z-debug.log:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'E:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: E:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;F:\Script\lrc-maker\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\税务证书应用客户端;C:\Users;Administrator\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\;C:\Users\Administrator\go\bin;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\;C:\Users\Administrator\go\bin;E:\Program Files\ffmpeg\bin;E:\Program Files\mpv;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\;f:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\bin;E:\Program Files\Pandoc\;E:\Program Files\nodejs\;E:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\;E:\Program Files\JetBrains\PyCharm Community Edition\bin;C:\Users\Administrator\AppData\Roaming\npm;E:\Program Files\Bandizip\;E:\Program Files\Microsoft VS Code\bin;C:\MinGW\bin;E:\Program\msys64\usr\bin;C:\Users\Administrator\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\Administrator\AppData\Local\Programs\Python\Python38\;E:\Program Files\JetBrains\PyCharm Community Edition\bin;;C:\Users\Administrator\AppData\Roaming\npm;E:\Program Files\Bandizip\;E:\Program\msys64\usr\bin
9 verbose lifecycle [email protected]~build: CWD: F:\Script\lrc-maker
10 silly lifecycle [email protected]~build: Args: [ '/d /s /c', 'make build' ]
11 silly lifecycle [email protected]~build: Returned: code: 2  signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: `make build`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (E:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (E:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd F:\Script\lrc-maker
16 verbose Windows_NT 6.1.7601
17 verbose argv "E:\\Program Files\\nodejs\\node.exe" "E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v12.18.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] build: `make build`
22 error Exit status 2
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

注意PATH


Makefile:59: recipe for target 'build/index.es6.js' failed;make: *** [build/index.es6.js] Error 1:

58|$(target_es6): $(metadata) $(src_ts) $(package_json)
59|	$(tsc) -b tsconfig.es6.json
60|	$(webpack) --mode=production --config=.webpack.config.cjs

@pzhlkj6612
Copy link
Contributor

这个项目的 Makefile 的各个目标均只包含 Linux shell 命令,但从你的提示符F:\Script\lrc-maker>可以看出,这是在 cmd 下进行的构建,所以失败。这与 VSCode 没有关系,只是你的 VSCode 采用 cmd 作为默认的终端。

看上去你错误地理解了我的上一条评论( #32 (comment) )中链接的关于在 Git Bash 中安装 rsync 的教程,所以你不仅额外安装了 MSYS2 ,而且还并没有在正确的环境( 你已有的 Git Bash 或新安装的 MSYS2 )中执行构建。你可以尝试在你的第一条评论( #32 (comment) )提及的环境( Git Bash )中按教程配置好 rsync ,再执行npm run build

顺带说一句,建议你使用 Hyper-V 或 VirtualBox 等软件的 Linux 虚拟机来进行开发,这样会更友好一些。

@unbadfish
Copy link
Author

已安装,又失败了

Administrator@PC--20180114RUC MINGW64 /f/Script/lrc-maker (master)
$ rsync -h
rsync  version 3.2.2  protocol version 31
Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, atimes, batchfiles, inplace,
    append, ACLs, no xattrs, optional protect-args, iconv, symtimes, prealloc
Optimizations:
    no SIMD, asm, openssl-crypto
Checksum list:
    xxh64 (xxhash) md5 md4 none
Compress list:
    zstd lz4 zlibx zlib none

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

rsync is a file transfer program capable of efficient remote update
via a fast differencing algorithm.

Usage: rsync [OPTION]... SRC [SRC]... DEST
  or   rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST
  or   rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST
  or   rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST
  or   rsync [OPTION]... [USER@]HOST:SRC [DEST]
  or   rsync [OPTION]... [USER@]HOST::SRC [DEST]
  or   rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]
The ':' usages connect via remote shell, while '::' & 'rsync://' usages connect
to an rsync daemon, and require SRC or DEST to start with a module name.

Options
--verbose, -v            increase verbosity
--info=FLAGS             fine-grained informational verbosity
--debug=FLAGS            fine-grained debug verbosity
--msgs2stderr            output messages directly to stderr
--quiet, -q              suppress non-error messages
--no-motd                suppress daemon-mode MOTD
--checksum, -c           skip based on checksum, not mod-time & size
--archive, -a            archive mode; equals -rlptgoD (no -H,-A,-X)
--no-OPTION              turn off an implied OPTION (e.g. --no-D)
--recursive, -r          recurse into directories
--relative, -R           use relative path names
--no-implied-dirs        don't send implied dirs with --relative
--backup, -b             make backups (see --suffix & --backup-dir)
--backup-dir=DIR         make backups into hierarchy based in DIR
--suffix=SUFFIX          backup suffix (default ~ w/o --backup-dir)
--update, -u             skip files that are newer on the receiver
--inplace                update destination files in-place
--append                 append data onto shorter files
--append-verify          --append w/old data in file checksum
--dirs, -d               transfer directories without recursing
--links, -l              copy symlinks as symlinks
--copy-links, -L         transform symlink into referent file/dir
--copy-unsafe-links      only "unsafe" symlinks are transformed
--safe-links             ignore symlinks that point outside the tree
--munge-links            munge symlinks to make them safe & unusable
--copy-dirlinks, -k      transform symlink to dir into referent dir
--keep-dirlinks, -K      treat symlinked dir on receiver as dir
--hard-links, -H         preserve hard links
--perms, -p              preserve permissions
--executability, -E      preserve executability
--chmod=CHMOD            affect file and/or directory permissions
--acls, -A               preserve ACLs (implies --perms)
--xattrs, -X             preserve extended attributes
--owner, -o              preserve owner (super-user only)
--group, -g              preserve group
--devices                preserve device files (super-user only)
--specials               preserve special files
-D                       same as --devices --specials
--times, -t              preserve modification times
--atimes, -U             preserve access (use) times
--open-noatime           avoid changing the atime on opened files
--omit-dir-times, -O     omit directories from --times
--omit-link-times, -J    omit symlinks from --times
--super                  receiver attempts super-user activities
--fake-super             store/recover privileged attrs using xattrs
--sparse, -S             turn sequences of nulls into sparse blocks
--preallocate            allocate dest files before writing them
--write-devices          write to devices as files (implies --inplace)
--dry-run, -n            perform a trial run with no changes made
--whole-file, -W         copy files whole (w/o delta-xfer algorithm)
--checksum-choice=STR    choose the checksum algorithm (aka --cc)
--one-file-system, -x    don't cross filesystem boundaries
--block-size=SIZE, -B    force a fixed checksum block-size
--rsh=COMMAND, -e        specify the remote shell to use
--rsync-path=PROGRAM     specify the rsync to run on remote machine
--existing               skip creating new files on receiver
--ignore-existing        skip updating files that exist on receiver
--remove-source-files    sender removes synchronized files (non-dir)
--del                    an alias for --delete-during
--delete                 delete extraneous files from dest dirs
--delete-before          receiver deletes before xfer, not during
--delete-during          receiver deletes during the transfer
--delete-delay           find deletions during, delete after
--delete-after           receiver deletes after transfer, not during
--delete-excluded        also delete excluded files from dest dirs
--ignore-missing-args    ignore missing source args without error
--delete-missing-args    delete missing source args from destination
--ignore-errors          delete even if there are I/O errors
--force                  force deletion of dirs even if not empty
--max-delete=NUM         don't delete more than NUM files
--max-size=SIZE          don't transfer any file larger than SIZE
--min-size=SIZE          don't transfer any file smaller than SIZE
--max-alloc=SIZE         change a limit relating to memory alloc
--partial                keep partially transferred files
--partial-dir=DIR        put a partially transferred file into DIR
--delay-updates          put all updated files into place at end
--prune-empty-dirs, -m   prune empty directory chains from file-list
--numeric-ids            don't map uid/gid values by user/group name
--usermap=STRING         custom username mapping
--groupmap=STRING        custom groupname mapping
--chown=USER:GROUP       simple username/groupname mapping
--timeout=SECONDS        set I/O timeout in seconds
--contimeout=SECONDS     set daemon connection timeout in seconds
--ignore-times, -I       don't skip files that match size and time
--size-only              skip files that match in size
--modify-window=NUM, -@  set the accuracy for mod-time comparisons
--temp-dir=DIR, -T       create temporary files in directory DIR
--fuzzy, -y              find similar file for basis if no dest file
--compare-dest=DIR       also compare destination files relative to DIR
--copy-dest=DIR          ... and include copies of unchanged files
--link-dest=DIR          hardlink to files in DIR when unchanged
--compress, -z           compress file data during the transfer
--compress-choice=STR    choose the compression algorithm (aka --zc)
--compress-level=NUM     explicitly set compression level (aka --zl)
--skip-compress=LIST     skip compressing files with suffix in LIST
--cvs-exclude, -C        auto-ignore files in the same way CVS does
--filter=RULE, -f        add a file-filtering RULE
-F                       same as --filter='dir-merge /.rsync-filter'
                         repeated: --filter='- .rsync-filter'
--exclude=PATTERN        exclude files matching PATTERN
--exclude-from=FILE      read exclude patterns from FILE
--include=PATTERN        don't exclude files matching PATTERN
--include-from=FILE      read include patterns from FILE
--files-from=FILE        read list of source-file names from FILE
--from0, -0              all *-from/filter files are delimited by 0s
--protect-args, -s       no space-splitting; wildcard chars only
--copy-as=USER[:GROUP]   specify user & optional group for the copy
--address=ADDRESS        bind address for outgoing socket to daemon
--port=PORT              specify double-colon alternate port number
--sockopts=OPTIONS       specify custom TCP options
--blocking-io            use blocking I/O for the remote shell
--outbuf=N|L|B           set out buffering to None, Line, or Block
--stats                  give some file-transfer stats
--8-bit-output, -8       leave high-bit chars unescaped in output
--human-readable, -h     output numbers in a human-readable format
--progress               show progress during transfer
-P                       same as --partial --progress
--itemize-changes, -i    output a change-summary for all updates
--remote-option=OPT, -M  send OPTION to the remote side only
--out-format=FORMAT      output updates using the specified FORMAT
--log-file=FILE          log what we're doing to the specified FILE
--log-file-format=FMT    log updates using the specified FMT
--password-file=FILE     read daemon-access password from FILE
--early-input=FILE       use FILE for daemon's early exec input
--list-only              list the files instead of copying them
--bwlimit=RATE           limit socket I/O bandwidth
--write-batch=FILE       write a batched update to FILE
--only-write-batch=FILE  like --write-batch but w/o updating dest
--read-batch=FILE        read a batched update from FILE
--protocol=NUM           force an older protocol version to be used
--iconv=CONVERT_SPEC     request charset conversion of filenames
--checksum-seed=NUM      set block/file checksum seed (advanced)
--ipv4, -4               prefer IPv4
--ipv6, -6               prefer IPv6
--version, -V            print the version + other info and exit
--help, -h (*)           show this help (* -h is help only on its own)

Use "rsync --daemon --help" to see the daemon-mode command-line options.
Please see the rsync(1) and rsyncd.conf(5) man pages for full documentation.
See https://rsync.samba.org/ for updates, bug reports, and answers

Administrator@PC--20180114RUC MINGW64 /f/Script/lrc-maker (master)
$ npm run build

> [email protected] build F:\Script\lrc-maker
> make build

node_modules/.bin/tsc -b
'node_modules' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Makefile:51: recipe for target 'build/components/app.context.js' failed
make: *** [build/components/app.context.js] Error 1
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `make build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-01-10T14_01_40_891Z-debug.log

@pzhlkj6612
Copy link
Contributor

没有node_modules/npm i

你没看文档

@unbadfish
Copy link
Author

我估计是这个的问题

"liveServer.settings.mount": [
        ["/node_modules", "./node_modules"],
        ["/src", "./src"]

最近学业繁忙,年前估计是用不了电脑了:cry:
……麻烦把ISSUE开着,谢谢。
如果有什么文件可以把链接发这里,我尽可能找时间看看。谢谢!

@pzhlkj6612
Copy link
Contributor

liveServer 是一个插件,在文档中有提及:

本项目没有配置本地服务器,实际开发中使用了 vs code 的插件 Live Server 并使用了以下配置。


过年期间记得装一个 Linux 虚拟机来优化你的开发体验 :)

@pzhlkj6612
Copy link
Contributor

如果你顺利地开始了npm run build可能会遇到这个问题:

npm run build
> [email protected] build M:\lrc-maker
> make build

mkdir -p build
cp -r assets/* build
mkdir -p build/lib
rsync -am --no-links --exclude 'node_modules' node_modules/react node_modules/react-dom build/lib
touch build/lib
node_modules/.bin/ts-node -P scripts/tsconfig.json scripts/generate.metadata.ts | tee src/metadata.d.ts > worker/metadata.d.ts
node_modules/.bin/tsc -b
node_modules/.bin/tsc -b tsconfig.es6.json
node_modules/.bin/webpack --mode=production --config=.webpack.config.cjs
[webpack-cli] Compilation finished
asset index.es6.js 85.7 KiB [emitted] [minimized] (name: main) 1 related asset
orphan modules 34.5 KiB [orphan] 11 modules
runtime modules 1.13 KiB 5 modules
modules by path ./node_modules/ 43.3 KiB
  modules by path ./node_modules/core-js/internals/*.js 30.3 KiB 60 modules
  modules by path ./node_modules/core-js/es/ 719 bytes 5 modules
  modules by path ./node_modules/core-js/modules/*.js 2.27 KiB 5 modules
  ./node_modules/tslib/tslib.es6.js 10 KiB [built] [code generated]
modules by path ./build.es6/ 130 KiB
  modules by path ./build.es6/components/ 60.2 KiB 8 modules
  modules by path ./build.es6/languages/ 19.2 KiB 7 modules
  modules by path ./build.es6/utils/*.js 6.22 KiB 5 modules
  modules by path ./build.es6/polyfill/*.js 4.24 KiB 3 modules
  modules by path ./build.es6/hooks/*.js 5.82 KiB 2 modules
  ./build.es6/index.js + 7 modules 30.6 KiB [built] [code generated]
  ./build.es6/lrc-parser.js 3.48 KiB [built] [code generated]
webpack 5.3.2 compiled successfully in 2710 ms
...
...
node_modules/.bin/postcss src/index.css -m -d build
Error: Failed to find './normalize.css'
  in [
    M:\lrc-maker\src
  ]
    at M:\lrc-maker\node_modules\postcss-import\lib\resolve-id.js:35:13
    at async LazyResult.runAsync (M:\lrc-maker\node_modules\postcss\lib\lazy-result.js:331:11)
    at async Promise.all (index 0)
make: *** [Makefile:45: build/index.css] Error 1

我不知道该如何解决它,只是猜测这可能是由 Windows 与 Unix 不同的路径风格所导致的。

为了把工作重心放到开发本身上,再次建议你去配置一个 Linux 虚拟机做开发。

@magic-akari
Copy link
Owner

如果提供一个 docker 的配置,是否有助于解决问题呢?

@pzhlkj6612
Copy link
Contributor

@magic-akari Hi.

用 docker 应该是能够解决问题的。但是 Docker Desktop on Windows 需要 Hyper-V [1]或 WSL 2 [2],个人感觉这与直接配置 Linux 虚拟机或 WSL 2 差不太多, docker 的参与并没有减少工作量。

说起 WSL ,其实 WSL 1 是值得一试的。不过,我之前在别的项目里遇到过某个包(似乎是 node-gyp )在 WSL 1 上构建失败的问题,于是就没有继续使用这个环境做开发了。


  1. ^ Install Docker Desktop on Windows | Docker Documentation § What to know before you install
    https://docs.docker.com/docker-for-windows/install/#what-to-know-before-you-install
  2. ^ Install Docker Desktop on Windows Home | Docker Documentation § What to know before you install
    https://docs.docker.com/docker-for-windows/install-windows-home/#what-to-know-before-you-install

@unbadfish
Copy link
Author

请问一下用cygwin行吗?
https://blog.csdn.net/ubuntu64fan/article/details/8533806
@pzhlkj6612

@unbadfish
Copy link
Author

好了
Build successfully
截图_2021-01-24_21-30-45
实测cygwin可以build
@magic-akari 建议加一个如何在Windows下build的markdown文件

@pzhlkj6612
Copy link
Contributor

这么说的话, MSYS2 应该也能成。

我的 Cygwin 的结果与 MSYS2 的一样( #32 (comment) ):

$ uname -a
CYGWIN_NT-10.0 BAZ 3.1.7(0.340/5/3) 2020-08-22 17:48 x86_64 Cygwin

$ npm run build

> [email protected] build M:\lrc-maker
> make build

...

node_modules/.bin/postcss src/index.css -m -d build
Error: Failed to find './normalize.css'
  in [
    M:\lrc-maker\src
  ]
    at M:\lrc-maker\node_modules\postcss-import\lib\resolve-id.js:35:13
    at async LazyResult.runAsync (M:\lrc-maker\node_modules\postcss\lib\lazy-result.js:331:11)
    at async Promise.all (index 0)
make: *** [Makefile:45: build/index.css] Error 1

@unbadfish 请问你具体是怎么配置环境的呢?

@unbadfish
Copy link
Author

unbadfish commented Jan 24, 2021

用的是Windows下的npm和node.js,别的明天再说……
请问一下要执行哪些命令以回答您的问题?
@pzhlkj6612

@pzhlkj6612
Copy link
Contributor

@unbadfish 额,我暂时想不出该问你啥,不好意思。等之后有时间了我找个干净的环境重新试一试。

感谢你所做的尝试。

@pzhlkj6612
Copy link
Contributor

@unbadfish ,你好!

在一个全新安装的 Windows 虚拟机中,我在一些环境中测试了 lrc-maker 的构建和运行情况:

环境

我使用了 node.js 14.17.0 ( npm 6.14.13 ),来自于 Node.js 的“ Windows Binary (.zip) ”。

Cygwin

结果:成功构建并启动程序。

配置:

$ cygcheck -c cygwin make rsync
Cygwin Package Information
Package              Version                         Status
cygwin               3.2.0-1                         OK
make                 4.3-1                           OK
rsync                3.2.3+20200903+git9f9240b-4     OK

$ uname -a
CYGWIN_NT-10.0 FOO 3.2.0(0.340/5/3) 2021-03-29 08:42 x86_64 Cygwin

MSYS2 (非 Git Bash )

结果:成功构建并启动程序。

配置:

$ pacman -Q msys2-runtime make rsync
msys2-runtime 3.2.0-3
make 4.3-1
rsync 3.2.3-1

$ uname -a
MSYS_NT-10.0-19041 FOO 3.2.0-340.x86_64 2021-04-02 09:40 UTC x86_64 Msys

值得注意的是,由于 MSYS2 和 MinTTY 存在问题,在执行 npm run dev-server 后输入 Ctrl-C 并不能结束 node.exe 的进程,而需要手动将其杀死( kill -9taskkill /f )。已经有 Git Bash 的使用者报告了这个问题( git-for-windows/git#1219nodejs/node#16103 ), Git for Windows 的维护者也已将其修复;但遗憾的是, MSYS2 似乎至今都还未修复它。

Git Bash

结果:失败,需要进一步的分析与调试,可能需要修改 Makefile 并调试 make.exe ,不过我暂时没时间研究它。

CMD

结果:失败, npm run build 无法按预期执行。

解释:由于 Makefile 含有调用 Linux 程序的命令(例如 rsyncmakefindcpmkdir ),我尝试使用 GnuWin Packages 移植的程序以满足该需求( rsync 则来自于 itefix.net 的 cwRsync )。在安装了 makefindutilscoreutils 这些包以后,那些程序几乎都能像在 Linux 环境中一样被正常使用。但是,由于 CMD 的内置命令 mkdir 无法被覆盖,直接执行 mkdir 并不会调用当前工作目录中或从 PATH 中找到的 mkdir.exe ,除非带上 mkdir.exe 的相对或绝对路径,因此,CMD 执行 mkdir -p build 这条命令后,会分别创建两个文件夹,一个名为“ -p ”,另一个名为“ build ”。

配置:

> make --version
GNU Make 3.81

> rsync --version
rsync  version 3.2.3  protocol version 31

> ver

Microsoft Windows [Version 10.0.19041.329]

结论和建议

看起来 Cygwin 和 MSYS2 都能够胜任 Windows 环境中的 node.js 开发。之前我在这两种环境中进行测试时出错,很有可能是因为项目文件位于 ImDisk Virtual Disk 创建的分区,使得 postcss 无法对其进行正确的处理。这需要进一步的分析。

当然,我认为最好还是在 Linux 环境中进行 node.js 开发。

@magic-akari
Copy link
Owner

@pzhlkj6612 感谢非常有价值的测试报告。
makefile 在一般的前端项目里较为少见,所以一般也很难找到这方面的解决方法。

我理解中,一般的 node.js 项目在 Windows 上开发应该是没有问题的。

@pzhlkj6612
Copy link
Contributor

@magic-akari ,谢谢回复。


……一般的 node.js 项目在 Windows 上开发应该是没有问题的。

我同意,毕竟 node.js for Windows 也是被官方支持的。

makefile 在一般的前端项目里较为少见 ……

没错。另外,由于本项目的 makefile 并没有考虑跨平台的情况(例如使用 ifeq ($(OS),Windows_NT) 语句),同时也无法由 CMake 或 qmake 等跨平台工具生成,所以该 makefile 只适用于你编写和测试它的环境(即 Linux 或 macOS )。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants