node.js - 在我的个人项目上安装 Node-Saas 错误
问题描述
我尝试使用添加node-sass
到我的项目中yarn add node-sass
,但我收到此错误任何人都可以帮助
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/7] ⠄ waiting...
[-/7] ⠄ waiting...
[7/7] ⠄ node-sass
[6/7] ⠄ pngcrush-bin
error /Users/user/Desktop/project/node_modules/gulp-sass/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: /Users/user/Desktop/project/node_modules/gulp-sass/node_modules/node-sass
Output:
Building: /usr/local/Cellar/node@16/16.13.0/libexec/node /Users/user/Desktop/project/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 '/usr/local/Cellar/node@16/16.13.0/libexec/node',
gyp verb cli '/Users/user/Desktop/project/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 node-gyp@3.8.0
gyp info using node@16.13.0 | darwin | 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 "/usr/local/opt/python@3.9/bin/python3" in the PATH
gyp verb `which` succeeded /usr/local/opt/python@3.9/bin/python3 /usr/local/opt/python@3.9/bin/python3
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /usr/local/opt/python@3.9/bin/python3 -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:397:12)
gyp ERR! stack at ChildProcess.emit (node:events:390:28)
gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
gyp ERR! System Darwin 21.1.0
gyp ERR! command "/usr/local/Cellar/node@16/16.13.0/libexec/node" "/Users/user/Desktop/project/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 /Users/user/Desktop/project/node_modules/gulp-sass/node_modules/node-sass
gyp ERR! node -v v16.13.0
固定的!
解决方案
我只是在笔记本电脑上遇到了 Node 版本的问题。
推荐阅读
- python - Python, Beautifullsoup - 获取 href 链接
- java - 如何创建单个类路径条目
- angular - NGRX 中效果的执行顺序
- r - mirt 图中的字体大小
- sql-server - 查询以在表中的所有列中搜索并加入
- macos - 在 Mac 机器上下载并安装 TortoiseSVN
- docker - Ubuntu 上的 Docker 无法访问 imternet
- reactjs - Firestore 承诺链接第二个链快照无法找到文档
- r - 取消列出数据框的列
- azure-eventgrid - 我们如何指示 Azure 事件网格 Webhook 订阅请求跳过服务器证书验证?