gyp ERR node-gyp失败处理

当前版本:
node v16.20.2
pnpm 8.14.3
npm 8.19.4

python失败

可以在微软的应用商店安装python

node-gyp安装了和node一样的版本,然后失败

│ Building: C:\Program Files\nodejs\node.exe D:\data\work_code\data\xiangm\node_modules\.pnpm\node-gyp@7.1.2\n…
│ gyp info it worked if it ends with ok
│ gyp verb cli [
│ gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
│ gyp verb cli   'D:\\data\\work_code\\优凯飞行\\web\\ucare管理后台\\webVueBackstageManage\\node_modules\\.pnpm\\node-gyp@7.1.2\\node_modules\\node…
│ gyp verb cli   'rebuild',
│ gyp verb cli   '--verbose',
│ gyp verb cli   '--libsass_ext=',
│ gyp verb cli   '--libsass_cflags=',
│ gyp verb cli   '--libsass_ldflags=',
│ gyp verb cli   '--libsass_library='
│ gyp verb cli ]
│ gyp info using node-gyp@7.1.2
│ gyp info using node@16.20.2 | win32 | x64
│ gyp verb command rebuild []
│ gyp verb command clean []
│ gyp verb clean removing "build" directory
│ gyp verb command configure []
│ gyp verb find Python Python is not set from command line or npm configuration
│ gyp verb find Python Python is not set from environment variable PYTHON
│ gyp verb find Python checking if "python3" can be used
│ gyp verb find Python - executing "python3" to get executable path
│ gyp verb find Python - executable path is "C:\Users\admin123\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\…
│ gyp verb find Python - executing "C:\Users\admin123\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.ex…
│ gyp verb find Python - version is "3.12.7"
│ gyp info find Python using Python version 3.12.7 found at "C:\Users\admin123\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.1…
│ gyp verb get node dir no --target version specified, falling back to host node version: 16.20.2
│ gyp verb command install [ '16.20.2' ]
│ gyp verb install input version string "16.20.2"
│ gyp verb install installing version: 16.20.2
│ gyp verb install --ensure was passed, so won't reinstall if already installed
│ gyp verb install version is already installed, need to check "installVersion"
│ gyp verb got "installVersion" 9
│ gyp verb needs "installVersion" 9
│ gyp verb install version is good
│ gyp verb get node dir target node version installed: 16.20.2
│ gyp verb build dir attempting to create "build" dir: D:\data\work_code\data\xiangm\node_modules\.pnpm\node-s…
│ gyp verb build dir "build" dir needed to be created? D:\data\work_code\data\xiangm\node_modules\.pnpm\node-s…
│ gyp verb find VS msvs_version not set from command line or npm config
│ gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
│ gyp verb find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
│ gyp verb find VS looking for Visual Studio 2015
│ gyp verb find VS - not found
│ gyp verb find VS not looking for VS2013 as it is only supported up to Node.js 8
│ 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 could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
│ 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:\data\work_code\data\xiangm\node_modules\.pnpm\node-gyp@7.1…
│ gyp ERR! stack     at D:\data\work_code\data\xiangm\node_modules\.pnpm\node-gyp@7.1.2\node_modules\node-gyp\…
│ gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (D:\data\work_code\data\xiangm\node_modules\.p…
│ gyp ERR! stack     at D:\data\work_code\data\xiangm\node_modules\.pnpm\node-gyp@7.1.2\node_modules\node-gyp\…
│ gyp ERR! stack     at D:\data\work_code\data\xiangm\node_modules\.pnpm\node-gyp@7.1.2\node_modules\node-gyp\…
│ gyp ERR! stack     at D:\data\work_code\data\xiangm\node_modules\.pnpm\node-gyp@7.1.2\node_modules\node-gyp\…
│ gyp ERR! stack     at D:\data\work_code\data\xiangm\node_modules\.pnpm\node-gyp@7.1.2\node_modules\node-gyp\…
│ gyp ERR! stack     at ChildProcess.exithandler (node:child_process:410:5)
│ gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
│ gyp ERR! stack     at maybeClose (node:internal/child_process:1100:16)
│ gyp ERR! System Windows_NT 10.0.22631
│ gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\data\\work_code\\优凯飞行\\web\\ucare管理后台\\webVueBackstageManage\\node_modules\\.…
│ gyp ERR! cwd D:\data\work_code\data\xiangm\node_modules\.pnpm\node-sass@6.0.1\node_modules\node-sass
│ gyp ERR! node -v v16.20.2
│ gyp ERR! node-gyp -v v7.1.2
│ gyp ERR! not ok
│ Build failed with error code: 1

各种修改版本都失败

"sass-loader": "^6.0.6",
"sass-resources-loader": "^1.3.3",

这个版本是没有问题的

解决方法

“vue”: “^2.5.2”,
升级为
“vue”: “^2.6.10”,
不知道为啥,升级之后,就正常了

最后结果

dependencies:
+ @liveqing/liveplayer 2.7.20
+ array-includes 3.1.7
+ axios 0.18.1
+ browser-md5-file 1.1.1
+ cesium 1.58.1
+ clipboard 2.0.11
+ d3 5.16.0
+ draggable 4.2.0
+ echarts 4.9.0
+ el-tree-transfer 2.4.7
+ element-china-area-data 4.2.0
+ element-ui 2.15.14
+ exif-js 2.3.0
+ file-saver 2.0.5
+ flv.js 1.6.2
+ jquery-ui 1.13.2
+ js-md5 0.7.3
+ jsbarcode 3.11.6
+ jszip 3.2.1
+ leaflet 1.3.1
+ leaflet-hotline 0.4.0
+ leaflet.elevation 0.0.3
+ node-sass 6.0.1
+ protobufjs 7.2.5
+ qrcode 1.5.3
+ qrcodejs2 0.0.2
+ quill 1.3.7
+ rbush 3.0.1
+ ui 0.2.4
+ vue 2.7.15
+ vue-area-linkage 5.1.0
+ vue-quill-editor 3.0.6
+ vue-router 3.6.5
+ vuex 3.6.2
+ wangeditor 3.1.1
+ widgets 0.3.4

devDependencies:
+ autoprefixer 7.2.6
+ babel-core 6.26.3
+ babel-helper-vue-jsx-merge-props 2.0.3
+ babel-loader 7.1.5
+ babel-plugin-syntax-jsx 6.18.0
+ babel-plugin-transform-runtime 6.23.0
+ babel-plugin-transform-vue-jsx 3.7.0
+ babel-polyfill 6.26.0
+ babel-preset-env 1.7.0
+ babel-preset-es2015 6.24.1
+ babel-preset-stage-2 6.24.1
+ chalk 2.4.2
+ copy-webpack-plugin 4.6.0
+ css-loader 0.28.11
+ extract-text-webpack-plugin 3.0.2
+ file-loader 1.1.11
+ friendly-errors-webpack-plugin 1.7.0
+ html-webpack-plugin 2.30.1
+ jquery 3.7.1
+ node-notifier 5.4.5
+ optimize-css-assets-webpack-plugin 3.2.1
+ ora 1.4.0
+ portfinder 1.0.32
+ postcss-import 11.1.0
+ postcss-loader 2.1.6
+ postcss-url 7.3.2
+ rimraf 2.7.1
+ sass-loader 6.0.7
+ sass-resources-loader 1.3.5
+ semver 5.7.2
+ shelljs 0.7.8
+ style-loader 0.21.0
+ uglifyjs-webpack-plugin 1.3.0
+ url-loader 0.5.9
+ vue-loader 13.7.3
+ vue-style-loader 3.1.2
+ vue-template-compiler 2.7.15
+ webpack 3.12.0
+ webpack-bundle-analyzer 2.13.1
+ webpack-dev-server 2.11.5
+ webpack-merge 4.2.2
+ webpack-parallel-uglify-plugin 1.1.4
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值