Closed dong-lufei closed 2 years ago
使用 node-gyp@7.1.2 这个版本看下, 8.3.0 的 node-gyp 需要 python3 https://github.com/nodejs/node-gyp#on-windows
windows 的 python3 安装地址 https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5
@wssgcg1213 windows的python3安装地址https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5 打开看不到:Sorry, we're unable to get you the application details
E:\test\rt> npm i
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated @stylelint/postcss-markdown@0.36.2: Use the original unforked package instead: postcss-markdown
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated @babel/traverse@7.17.10: [WARNING] Use 7.17.9 instead of 7.17.10, reason: https://github.com/babel/babel/issues/14525
npm ERR! code 1
npm ERR! path E:\test\rt\node_modules\qjsc
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�-m�����ء�
npm ERR! qjsc_20210327.cc
npm ERR! cutils.c
npm ERR! E:\test\rt\node_modules\qjsc\deps\quickjs_2021_03_27\cutils.c(300,11): warning C4018: ��<��: �з���/���Ų�ƥ�� [E:\test\rt\node_modules\qjsc\build\qjsc_20210327.vcxproj]
npm ERR! libregexp.c
npm ERR! E:\test\rt\node_modules\qjsc\deps\quickjs_2021_03_27\libregexp.c(2260,13): warning C4018: ��<��: �з���/���Ų�ƥ�� [E:\test\rt\node_modules\qjsc\build\qjsc_20210327.vcxproj]
npm ERR! E:\test\rt\node_modules\qjsc\deps\quickjs_2021_03_27\libregexp.c(2269,17): warning C4018: ��<��: �з���/���Ų�ƥ�� [E:\test\rt\node_modules\qjsc\build\qjsc_20210327.vcxproj]
npm ERR! E:\test\rt\node_modules\qjsc\deps\quickjs_2021_03_27\libregexp.c(2330,25): warning C4018: ��>=��: �з���/���Ų�ƥ�� [E:\test\rt\node_modules\qjsc\build\qjsc_20210327.vcxproj]
npm ERR! libunicode.c
npm ERR! E:\test\rt\node_modules\qjsc\deps\quickjs_2021_03_27\libunicode.c(676,28): warning C4018: ��<��: �з���/���Ų�ƥ�� [E:\test\rt\node_modules\qjsc\build\qjsc_20210327.vcxproj]
npm ERR! quickjs.c
npm ERR! E:\test\rt\node_modules\qjsc\deps\quickjs_2021_03_27\quickjs.c(145,10): fatal error C1083: ����� ��ļ�: ��pthread.h��: No such file or directory [E:\test\rt\node_modules\qjsc\build\qjsc_20210327.vcxproj]
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.4 found at "C:\Users\13697\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
npm ERR! gyp info find VS using VS2022 (17.1.32421.90) found at:
npm ERR! gyp info find VS "D:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\13697\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\Users\13697\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'E:\test\rt\node_modules\qjsc\build\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\Users\13697\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\Users\13697\AppData\Local\node-gyp\Cache\16.13.1\include\node\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\Users\13697\AppData\Local\node-gyp\Cache\16.13.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\Users\13697\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\Users\\13697\\AppData\\Local\\node-gyp\\Cache\\16.13.1\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=E:\test\rt\node_modules\qjsc',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'E:\test\rt\node_modules\qjsc\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn D:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: D:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onExit (C:\Users\13697\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "D:\Program Files\nodejs\node.exe" "C:\Users\13697\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd E:\test\rt\node_modules\qjsc
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\13697\AppData\Local\npm-cache_logs\2022-05-09T06_39_13_312Z-debug-0.log
warning "@iceworks/spec > @typescript-eslint/eslint-plugin > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". [4/4] Building fresh packages... [-/4] ⢀ waiting... [2/4] ⢀ esbuild [3/4] ⢀ core-js error E:\test\rt\node_modules\qjsc: Command failed. Exit code: 1 Command: node install.js Arguments: Directory: E:\test\rt\node_modules\qjsc Output: E:\test\rt\node_modules\qjsc>if not defined npm_config_node_gyp (node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp info it worked if it ends with ok gyp info using node-gyp@8.3.0 gyp info using node@16.13.1 | win32 | x64 gyp info find Python using Python version 3.10.4 found at "C:\Users\13697\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" gyp ERR! find VS gyp ERR! find VS msvs_version not set from command line or npm config gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt gyp ERR! find VS unknown version "undefined" found at "D:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use gyp ERR! find VS looking for Visual Studio 2015 gyp ERR! find VS - not found gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 gyp ERR! find VS gyp ERR! find VS ** gyp ERR! find VS You need to install the latest version of Visual Studio gyp ERR! find VS including the "Desktop development with C++" workload. gyp ERR! find VS For more information consult the documentation at: gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows gyp ERR! find VS ** gyp ERR! find VS gyp ERR! configure error gyp ERR! stack Error: Could not find any Visual Studio installation to use gyp ERR! stack at VisualStudioFinder.fail (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47) gyp ERR! stack at D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16 gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14) gyp ERR! stack at D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14 gyp ERR! stack at D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16 gyp ERR! stack at D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7 gyp ERR! stack at D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16 gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5) gyp ERR! stack at ChildProcess.emit (node:events:390:28) gyp ERR! stack at maybeClose (node:internal/child_process:1064:16) gyp ERR! System Windows_NT 10.0.22000 gyp ERR! command "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd E:\test\rt\node_modules\qjsc gyp ERR! node -v v16.13.1
可以重试一下,现在应该没问题了
node v16.13.1 npm 8.5.3 yarn 1.22.17
我就 npm init rax test2 选择app 选择小程序跨端应用 JavaScript
cd test2 npm install或yarn就报错: warning "rax-app > build-plugin-rax-app > rax-jest-config > babel-jest > babel-preset-jest > babel-preset-current-node-syntax > @babel/plugin-syntax-import-meta@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-0". [4/4] Building fresh packages... [7/7] ⠄ qjsc [-/7] ⠄ waiting... [-/7] ⠄ waiting... [-/7] ⡀ waiting... error E:\MengMan\MengMan-mnp\packages\mainApp\node_modules\qjsc: Command failed. Exit code: 1 Command: node install.js Arguments: Directory: E:\MengMan\MengMan-mnp\packages\mainApp\node_modules\qjsc Output: E:\MengMan\MengMan-mnp\packages\mainApp\node_modules\qjsc>if not defined npm_config_node_gyp (node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp info it worked if it ends with ok gyp info using node-gyp@8.3.0 gyp info using node@16.13.1 | win32 | x64 gyp ERR! find Python gyp ERR! find Python checking Python explicitly set from command line or npm configuration gyp ERR! find Python - "--python=" or "npm config get python" is "D:\Python27\python.exe" gyp ERR! find Python - executable path is "D:\Python27\python.exe" gyp ERR! find Python - version is "2.7.0" gyp ERR! find Python - version is 2.7.0 - should be >=3.6.0 gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED gyp ERR! find Python Python is not set from environment variable PYTHON gyp ERR! find Python checking if "python3" can be used gyp ERR! find Python - "python3" is not in PATH or produced an error gyp ERR! find Python checking if "python" can be used gyp ERR! find Python - "python" is not in PATH or produced an error gyp ERR! find Python checking if Python is C:\Users\13697\AppData\Local\Programs\Python\Python39\python.exe gyp ERR! find Python - "C:\Users\13697\AppData\Local\Programs\Python\Python39\python.exe" could not be run gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe