我只想為 laravel nova 創建一個組件,但在 npm 安裝程序中出現以下錯誤。我嘗試在其他專案中安裝 node-sass 沒有問題,但是在這個組件中,我會得到同樣的錯誤。
請注意 package.json 和 composer.json 中的專案名稱與錯誤日志中的不同 - 我在這里為我的組件嘗試了另一個名稱,但錯誤仍然相同。
希望有人可以提供幫助.. 在我的辦公室里,沒有人知道我能做什么,不知道這個錯誤可能會發生。現在在那兒坐一會兒。
到現在為止我做了什么?
- 重新安裝 nodejs/npm
- 更新/重新安裝 MSBuild 工具(2017 / 2019 / 2022)
- 重新安裝python2
- 重新安裝 git
- 檢查了我的環境變數
- 洗掉組件并創建新組件,即使使用其他名稱
- 嘗試了不同的終端(windows cmd,mingw64)
軟體版本
- npm 版本 8.3.0
- nodejs v17.3.0(甚至嘗試使用版本 16)
- 蟒蛇2.7
- Visual Studio 構建工具 2017 v15.9.42
- Visual Studio 構建工具 2019 v16.11.8
- Visual Studio Build Tools 2022 v17.0.4(但我認為沒有必要?)
- Windows 10 21H1(內部版本 19043.1288)
錯誤資訊
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14 . Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14 . Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14 . Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated extract-text-webpack-plugin@3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
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@2.0.3: 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 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 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 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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm WARN deprecated svgo@0.7.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up
to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path C:\dev\vierol-shop-relaunch\nova-components\Test\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\dev\vierol-shop-relaunch\nova-components\Test\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli 'C:\\dev\\vierol-shop-relaunch\\nova-components\\Test\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@17.3.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2.exe" in the PATH
npm ERR! gyp verb `which` succeeded python2.exe C:\Python27\python2.exe
npm ERR! gyp verb check python version `C:\Python27\python2.exe -c "import sys; print "2.7.18
npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 17.3.0
npm ERR! gyp verb command install [ '17.3.0' ]
npm ERR! gyp verb install input version string "17.3.0"
npm ERR! gyp verb install installing version: 17.3.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 17.3.0
npm ERR! gyp verb build dir attempting to create "build" dir: C:\dev\vierol-shop-relaunch\nova-components\Test\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? C:\dev\vierol-shop-relaunch\nova-components\Test\node_modules\node-sass\build
npm ERR! gyp verb find vs2017 Found installation at: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
npm ERR! gyp verb find vs2017 - Found Microsoft.VisualStudio.Component.Windows10SDK.19041
npm ERR! gyp ERR! <https://github.com/nodejs/node-gyp/issues>
npm ERR! Build failed with error code: 7
comopser.json
{
"name": "vs/test",
"description": "A Laravel Nova card.",
"keywords": [
"laravel",
"nova"
],
"license": "MIT",
"require": {
"php": ">=7.1.0"
},
"autoload": {
"psr-4": {
"Vs\\Test\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Vs\\Test\\CardServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
包.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"cross-env": "^5.0.0",
"laravel-mix": "^1.0"
},
"dependencies": {
"vue": "^2.5.0"
}
}
uj5u.com熱心網友回復:
目前還不清楚它試圖安裝什么版本的 node-sass,但我從 node-gyp 3.8 猜測它大約是 4.x,所以它可能支持的最新版本的 Node 是 14 https://github.com/sass /node-sass#node-version-support-policy
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/408379.html
標籤:
