Yarn 无法构建 node-sass('命令失败')

问题描述 投票:0回答:1

我正在尝试使用 yarn 纠正基础站点的灌输,以按照 foundation-cli 推荐的方式纠正安装。这是纱线错误日志。两次尝试失败;即使在我删除

yarn.lock
并运行
npm install -g node-sass
之后,他们也遇到了几乎相同的错误。

另一个可能有助于提及的问题是运行

npm install --global windows-build-tools
(正如我在之前的一篇相关问题的 stackoverflow 文章中看到的那样)在灌注结束时如何冻结。

D:\Documents\field-benders-webpage>yarn
yarn install v1.22.19
info No lockfile found.
[1/4] Resolving packages...
warning gulp > glob-watcher > [email protected]: Chokidar 
2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
warning gulp > glob-watcher > chokidar > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning gulp > glob-watcher > anymatch > micromatch > snapdragon > [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
warning gulp > glob-watcher > anymatch > micromatch > snapdragon > source-map-resolve > [email protected]: 
See https://github.com/lydell/source-map-url#deprecatedwarning gulp > glob-watcher > anymatch > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning gulp > glob-watcher > anymatch > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning gulp-imagemin > imagemin-svgo > [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
warning gulp-imagemin > imagemin-svgo > svgo > [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
warning gulp-imagemin > imagemin-gifsicle > gifsicle > 
bin-build > tempfile > [email protected]: 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.
warning gulp-sass > node-sass > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning gulp-sass > node-sass > node-gyp > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning gulp-sass > node-sass > request > [email protected]: 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.
warning gulp-sass > node-sass > node-gyp > [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.        
warning gulp-sass > node-sass > request > [email protected]: this library is no longer supported
warning gulp-sourcemaps > css > [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
warning node-sass > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning panini > [email protected]: Version no longer 
supported. Upgrade to @latest
warning style-sherpa > [email protected]: Version no longer supported. Upgrade to @latest
warning uncss > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning uncss > jsdom > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning uncss > jsdom > [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > [email protected]" has incorrect peer 
dependency "motion-ui@latest".
[4/4] Building fresh packages...
[6/6] ⠂ node-sass
[-/6] ⠂ waiting...
[-/6] ⠂ waiting...
[-/6] ⠂ waiting...
error D:\Documents\field-benders-webpage\node_modules\gulp-sass\node_modules\node-sass: Command failed.       
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: D:\Documents\field-benders-webpage\node_modules\gulp-sass\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe D:\Documents\field-benders-webpage\node_modules\gulp-sass\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
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:\\Documents\\field-benders-webpage\\node_modules\\gulp-sass\\node_modules\\node-gyp\\bin\\node-gyp.js',
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 [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2      
gyp verb `which` failed     at getNotFoundError (D:\Documents\field-benders-webpage\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\Documents\field-benders-webpage\node_modules\which\which.js:68:19)       
gyp verb `which` failed     at E (D:\Documents\field-benders-webpage\node_modules\which\which.js:80:29)       
gyp verb `which` failed     at D:\Documents\field-benders-webpage\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\Documents\field-benders-webpage\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\Documents\field-benders-webpage\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\Documents\field-benders-webpage\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\Documents\field-benders-webpage\node_modules\which\which.js:68:19)       
gyp verb `which` failed     at E (D:\Documents\field-benders-webpage\node_modules\which\which.js:80:29)       
gyp verb `which` failed     at D:\Documents\field-benders-webpage\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\Documents\field-benders-webpage\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\Documents\field-benders-webpage\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\epicd\AppData\Local\Programs\Python\Python38-32\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\epicd\AppData\Local\Programs\Python\Python38-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];    
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                       ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:399:12)
gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
gyp ERR! System Windows_NT 10.0.19044
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" 
"D:\\Documents\\field-benders-webpage\\node_modules\\gulp-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" 
"--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\Documents\field-benders-webpage\node_modules\gulp-sass\node_modules\node-sass
gyp ERR! node -v v16.14.2
gyp ERR! node-gyp -v v3.8.0
node.js npm yarnpkg
1个回答
0
投票

你有没有试过用'sass'替换'node-sass'

node-sass 已弃用

仍然使用它的项目建议转移到 Dart Sass。

© www.soinside.com 2019 - 2024. All rights reserved.