node.js - 错误/node_modules/node-sass : Command failed

标签 node.js vue.js yarnpkg

当我尝试在本地安装 vue store front 但当我尝试“yarn install”命令时,出现以下错误。我该如何解决这个错误?我该如何解决这个错误?

error /var/www/html/vue-storefront/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments: 
Directory: /var/www/html/vue-storefront/node_modules/node-sass
Output:
Building: /usr/bin/node /var/www/html/vue-storefront/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/bin/node',
gyp verb cli   '/var/www/html/vue-storefront/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@13.9.0 | linux | 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/bin/python3.6" in the PATH
gyp verb `which` succeeded /usr/bin/python3.6 /usr/bin/python3.6
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /usr/bin/python3.6 -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 (child_process.js:303:12)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1026:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
gyp ERR! System Linux 4.15.0-88-generic
gyp ERR! command "/usr/bin/node" "/var/www/html/vue-storefront/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /var/www/html/vue-storefront/node_modules/node-sass
gyp ERR! node -v v13.9.0

最佳答案

我遇到了同样的问题,将 node-sass 版本升级为与 node 版本相同。用 yarn 运行:

yarn add node-sass
这将升级版本并解决问题

关于node.js - 错误/node_modules/node-sass : Command failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60394291/

相关文章:

npm - yarn 安装 |警告模式正在尝试在同一目的地解包

node.js - 由于 Yarn 和 npm 锁文件冲突,Heroku 构建失败

javascript - 编码无法发送到 API Node JS 的奇怪字符

node.js - 如何使用 mocha 测试我的 express 应用程序?

vue.js - 如何在我的 vue-route 中使用 vue-i18n?

javascript - 如何使用 webpack 2.7 将 Vue.js 置于生产模式?

node.js - 尝试安装 gulp 和 Bower 时出现 NPM 错误

node.js - Deno 1.1.1 静态 HTTP 服务器

javascript - 如果字符超过 Vue.js 中的限制,则仅显示名称的一部分

javascript - vue中如何给对象添加属性