Suc*_*Man 59 sqlite node.js npm vue.js adonis.js
我想运行这个项目:https : //github.com/adonis-china/adonis-adminify
当我运行时npm install,存在错误:
> sqlite3@3.1.13 install C:\laragon\www\adonis-admin\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@10.15.0 (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@10.15.0 (node-v64 ABI) (falling back to source compile with node-gyp)
gyp ERR! gypfind VS
gyp ERR!ERR! find VSfind VS
msvs_version not set from command line or npm config
gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config
VCINSTALLDIR not set, not running in VS Command Prompt
gyp gypERR! ERR! find VSfind VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp checking VS2019 (16.2.29230.47) found at:
gypERR! find VSERR! checking VS2019 (16.2.29230.47) found at:
gyp find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional"
ERR!gyp find VS ERR! "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional"
gypfind VS ERR! - "Visual Studio C++ core features" missing
gyp ERR!find VS - "Visual Studio C++ core features" missing
find VSgyp could not find a version of Visual Studio 2017 or newer to use
gypERR! ERR!find VS could not find a version of Visual Studio 2017 or newer to use
find VS looking for Visual Studio 2015
gyp gyp ERR!ERR! find VSfind VS looking for Visual Studio 2015
- not found
gyp gyp ERR!ERR! find VSfind VS - not found
not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR!gyp ERR!find VS find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp gypERR! ERR!find VS
gypfind VS **************************************************************
gypERR! ERR!find VS find VS **************************************************************
You need to install the latest version of Visual Studio
gypgyp ERR! ERR!find VS find VS You need to install the latest version of Visual Studio
including the "Desktop development with C++" workload.
gypgyp ERR!ERR! find VS find VS including the "Desktop development with C++" workload.
For more information consult the documentation at:
gyp ERR!gyp find VS For more information consult the documentation at:
ERR!gyp ERR! find VSfind VS https://github.com/nodejs/node-gyp#on-windows
https://github.com/nodejs/node-gyp#on-windows
gyp gyp ERR!ERR! find VS **************************************************************
find VSgyp **************************************************************
gypERR! find VS
ERR! find VS
gyp gypERR! ERR!configure error
configure errorgyp
ERR! stackgyp Error: Could not find any Visual Studio installation to use
gypERR! stackERR! Error: Could not find any Visual Studio installation to use
stackgyp at VisualStudioFinder.fail (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
ERR!gyp stack at VisualStudioFinder.fail (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
ERR! gypstack at findVisualStudio2013 (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16)
gypERR! ERR!stack at findVisualStudio2013 (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16)
stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:344:14)
gypgyp ERR! stack at findVisualStudio2015 (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14)
gypERR! ERR! stackstack at regSearchKeys (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:365:16)
at VisualStudioFinder.findVisualStudio2013 (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:344:14)
gyp gypERR! ERR!stack stack at regGetValue (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7)
at findVisualStudio2015 (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14)
gypgyp ERR!ERR! stackstack at C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp at regSearchKeys (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:365:16)
gyp ERR! ERR!stack at ChildProcess.exithandler (child_process.js:301:5)
gypstack at regGetValue (C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7)
ERR! gypstack at ChildProcess.emit (events.js:182:13)
gypERR! ERR! stack at C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
stack at maybeClose (internal/child_process.js:962:16)
gyp gypERR! ERR! System Windows_NT 10.0.17134
stackgyp at ChildProcess.exithandler (child_process.js:301:5)
ERR!gyp commandERR! "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Chelsea\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\laragon\\www\\adonis-admin\\node_modules\\sqlite3\\lib\\binding\\node-v64-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\\laragon\\www\\adonis-admin\\node_modules\\sqlite3\\lib\\binding\\node-v64-win32-x64" "--python=C:\\Users\\Chelsea\\.windows-build-tools\\python27\\python.exe"
gypstack at ChildProcess.emit (events.js:182:13)
gypERR! ERR!cwd C:\laragon\www\adonis-admin\node_modules\sqlite3
gypstack ERR! at maybeClose (internal/child_process.js:962:16)
node -v v10.15.0
gypgyp ERR!ERR! Systemnode-gyp -v Windows_NT 10.0.17134
v5.0.3
gypgyp ERR!ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Chelsea\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\laragon\\www\\adonis-admin\\node_modules\\sqlite3\\lib\\binding\\node-v64-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\\laragon\\www\\adonis-admin\\node_modules\\sqlite3\\lib\\binding\\node-v64-win32-x64" "--python=C:\\Users\\Chelsea\\.windows-build-tools\\python27\\python.exe"
not okgyp
ERR! cwd C:\laragon\www\adonis-admin\node_modules\sqlite3
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\laragon\www\adonis-admin\node_modules\sqlite3\lib\binding\node-v64-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\laragon\www\adonis-admin\node_modules\sqlite3\lib\binding\node-v64-win32-x64 --python=C:\Users\Chelsea\.windows-build-tools\python27\python.exe' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\laragon\www\adonis-admin\node_modules\sqlite3\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\laragon\\www\\adonis-admin\\node_modules\\sqlite3\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\laragon\www\adonis-admin\node_modules\sqlite3
node-pre-gyp ERR! node -v v10.15.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Chelsea\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\laragon\www\adonis-admin\node_modules\sqlite3\lib\binding\node-v64-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\laragon\www\adonis-admin\node_modules\sqlite3\lib\binding\node-v64-win32-x64 --python=C:\Users\Chelsea\.windows-build-tools\python27\python.exe' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@3.1.13 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@3.1.13 install 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\Chelsea\AppData\Roaming\npm-cache\_logs\2019-09-10T22_53_41_072Z-debug.log
Run Code Online (Sandbox Code Playgroud)
我该如何解决错误?
CPH*_*hon 79
使用Visual Studio安装拿到桌面开发与C ++ 的工作量在Visual Studio的版本之一,你已经安装在你的机器:
通读日志,主要错误是由于:
msvs_version未从命令行或 npm 配置设置
在此之后,您会发现其中一些:
缺少“Visual Studio C++ 核心功能”
然后:
您需要安装最新版本的 Visual Studio,包括“使用 C++ 进行桌面开发”工作负载。
有关更多信息,请参阅以下位置的文档:
最后:
找不到任何要使用的Visual Studio 安装
所以要解决这个问题,你只需要得到“用C++进行桌面开发”的工作量。
gyp然后会找到那个版本并使用它:
gyp info find Python using Python version 3.8.1 found at "C:\Users\USER\AppData\Local\Programs\Python\Python38-32\python.exe"
gyp info find VS using VS2019 (16.4.29709.97) 在以下位置找到:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\
免责声明:我没有测试任何这些解决方案。
正如Hamid Jolany 的回答所暗示的那样,在管理shell 上,只需全局安装构建工具包(node-gyp README):
npm i -g windows-build-tools
Run Code Online (Sandbox Code Playgroud)
Ragavan避免安装 Visual Studio的想法/答案有一些逻辑:
npm config get msvs_version(如果有,请跳到第 4 步并尝试设置环境变量)npm config set msvs_version 2019 --global(或npm config set msvs_version 2015 --global根据 Ragavan 的想法)VCTargetsPath环境变量(Win+ 搜索var)设置为适当的路径(例如C:\Program Files (x86)\MSBuild\Microsoft\Portable\v5.0)或通过以管理员身份运行终端,如 Ragavan 使用 2015 构建工具的想法:set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140$env:VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140旁注:
Dyl*_*lan 19
为了让它与 Visual Studio 2022 一起工作,我必须运行:
npm config set msbuild_path "C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\MSBuild.exe"
Run Code Online (Sandbox Code Playgroud)
小智 12
使用 Microsoft 的 windows-build-toolsnpm install --global windows-build-tools从提升的 PowerShell 或 CMD.exe(以管理员身份运行)安装所有必需的工具和配置。
小智 9
我终于解决了这个问题,这就是我的做法
npm config get msvs_version我的意思是未定义)npm config set msvs_version 2022 --global(我不再看到未定义的了)npm install. 然后我运行我的自动化,但这次我看到了(杂项警告SELF_SIGNED_CERT_IN_CHAIN:)NODE_TLS_REJECT_UNAUTHORIZED=0,瞧!这是工作我希望这会有所帮助。这真的很烦人,因为我的一些自动化文件无法正常工作
我想提供最近的更新。在处理这个问题一段时间后,我很清楚某些版本的节点(当前使用 14.19.1)无法正确检测 Visual Studio 2022 的构建工具。但是,它们在检测构建工具时没有问题对于 Visual Studio 2019。通过将 Visual Studio 2019 与 Visual Studio 2022 一起安装,我能够让一切正常工作。首先,您必须撤消您一直在尝试执行的所有修复:
npm config delete msvs_version
npm config delete msvs_version --global
npm config delete msbuild_path
npm config delete msbuild_path --global
Run Code Online (Sandbox Code Playgroud)
然后,下载Visual Studio 2019 Community,在安装过程中必须选择“使用C++进行桌面开发”。此时,当运行 npm install 时,node-gyp 仍然会找到您的 Visual Studio 2022 安装目录并尝试使用它(即使您将 msvs_version 设置为 2019),因此您必须将 VCINSTALLDIR 添加到您的用户环境变量(Start、System属性、环境变量)使用此目录:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC
Run Code Online (Sandbox Code Playgroud)
之后,在命令提示符下运行“refreshenv”,然后运行 npm install,你就会感到神清气爽,痛苦结束了。这类问题对于我们程序员来说是非常不幸的。希望这对你有用。
小智 6
Visual Studio Installer -> Modify Installed(Visual Studio Community 2019) -> Workloads(tab) -> [x] Desktop development with C++ -> Install
在“npm install”之前使用此命令
npm config set msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe
将 \Enterprise\ 更改为 \Community\ 对我有用。
| 归档时间: |
|
| 查看次数: |
94310 次 |
| 最近记录: |