Yarn - Node Sass 尚不支持我当前的环境

本文介绍了Yarn - Node Sass 尚不支持我当前的环境的处理方法,对大家解决问题具有一定的参考价值

问题描述

我正在使用 Sage WordPress 入门主题 - https://github.com/roots/sage.

从今天开始,当我运行 yarn build (webpack --progress --config/webpack.config.js) 出现这个错误:模块构建失败:ModuleBuildError:模块构建失败:错误:Node Sass 尚不支持您当前的环境:OS X 64-bit with Unsupported runtime (72)有关支持哪些环境的更多信息,请参阅:https://github.com/sass/node-sass/releases/tag/v4.8.3

我也尝试卸载并重新安装 node、npm &用 brew 制作纱线,但没有任何变化.

如果我运行 npm install 这是错误

../src/create_string.cpp:17:25: 错误:没有匹配的构造函数用于初始化 'v8::String::Utf8Value'v8::String::Utf8Value string(value);^~~~~~~/Users/MYPC/.node-gyp/12.1.0/include/node/v8.h:3002:5:注意:候选构造函数不可行:没有来自v8::Local"的已知转换'const v8::String::Utf8Value'对于第一个参数Utf8Value(const Utf8Value&) = delete;^/Users/MYPC/.node-gyp/12.1.0/include/node/v8.h:2995:5:注意:候选构造函数不可行:需要2个参数,但提供了1个Utf8Value(Isolate*isolate, Localobj);^产生了 1 个错误.make: *** [Release/obj.target/binding/src/create_string.o] 错误 1吉普错误!构建错误吉普错误!堆栈错误:`make` 失败,退出代码:2吉普错误!堆栈在 ChildProcess.onExit (/Users/MYPC/mysiteteam/node_modules/node-gyp/lib/build.js:262:23)吉普错误!ChildProcess.emit 处的堆栈(events.js:196:13)吉普错误!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)吉普错误!系统达尔文 18.5.0吉普错误!命令/usr/local/Cellar/node/12.1.0/bin/node"/Users/MYPC/mysiteteam/node_modules/node-gyp/bin/node-gyp.js"重建"--verbose""--libsass_ext=""--libsass_cflags=""--libsass_ldflags=""--libsass_library="吉普错误!cwd/Users/MYPC/mysiteteam/node_modules/node-sass吉普错误!节点 -v v12.1.0吉普错误!节点-gyp -v v3.8.0吉普错误!不好构建失败,错误代码:1npm WARN stylelint-webpack-plugin@0.10.5 需要 webpack@^1.13.2 的 peer ||^2.7.0 ||^3.11.0 ||^4.4.0 但没有安装.您必须自己安装对等依赖项.npm WARN ajv-keywords@2.1.1 需要 ajv@^5.0.0 的对等点,但没有安装.您必须自己安装对等依赖项.npm 错误!代码生命周期npm 错误!错误号 1npm 错误!**node-sass@4.9.4 安装后:`节点脚本/build.js`**npm 错误!退出状态 1npm 错误!npm 错误!在 node-sass@4.9.4 安装后脚本中失败.npm 错误!这可能不是 npm 的问题.上面可能有额外的日志输出.npm 错误!可以在以下位置找到此运行的完整日志:npm 错误!/Users/MYPC/.npm/_logs/2019-05-03T16_22_30_277Z-debug.log

所以我试图用这个命令行重建 node-sass npm rebuild node-sass --force 但错误是一样的!!!>

更多信息

MacOs Mojave 版本 10.14.4

2,7 GHz 英特尔酷睿 i7

npm -v

6.9.0

节点 -v

v12.1.0

纱线 -v

1.15.2

package.json 依赖

 "devDependencies": {"autoprefixer": "~8.2.0",浏览器同步":~2.24.7""browsersync-webpack-plugin": "^0.6.0","bs-html-injector": "~3.0","buble-loader": "^0.4.1",缓存加载器":~1.2.5""clean-webpack-plugin": "^0.1.18","copy-globs-webpack-plugin": "^0.2.0","css-loader": "^0.28.9","cssnano": "~4.0.5","eslint": "~4.19.1","eslint-loader": "~1.9","eslint-plugin-import": "~2.14.0","extract-text-webpack-plugin": "~3.0.2","文件加载器": "^1.1.6","friendly-errors-webpack-plugin": "^1.6.1","imagemin-mozjpeg": "~7.0.0","imagemin-webpack-plugin": "~2.2.0","import-glob": "~1.5","node-sass": "~4.9.4","postcss-loader": "~2.1.0","postcss-safe-parser": "~3.0","resolve-url-loader": "~2.3.1","rimraf": "~2.6","sass-loader": "~6.0","style-loader": "^0.22.1","stylelint": "^8.4.0","stylelint-config-standard": "~18.2.0","stylelint-webpack-plugin": "^0.10.5","uglifyjs-webpack-plugin": "^1.3.0","url-loader": "^0.6.2","webpack": "~3.10.0","webpack-assets-manifest": "^1.0.0","webpack-dev-middleware": "~2.0.4","webpack-hot-middleware": "~2.22.3","webpack-merge": "~4.1.4",yargs":~11.0.0"},依赖关系":{"jquery": "^3.3.1","slick-carousel": "^1.8.1","popper.js": "^1.14.7"}

我做错了什么?

解决方案

我使用的是 OSX 最新版本(10.14.4 (18E226)) 和 node 12.

在使用 node-sass 4.11 时,我遇到了 g++ 错误(../src/create_string.cpp:17:25: error: no matching constructor for initialization of 'v8::String::Utf8Value') 同时尝试 npm installnpm 重建(link) 无效.

我通过将 node-sass 更新到 4.12(npm install node-sass) 解决了这个问题,因为 github issue 说在 4.12 版本中实现了对 node 12 的支持.

I'm using Sage WordPress starter theme - https://github.com/roots/sage.

From today when I run yarn build (webpack --progress --config /webpack.config.js) appears this error: Module build failed: ModuleBuildError: Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (72) For more information on which environments are supported please see: https://github.com/sass/node-sass/releases/tag/v4.8.3

I also try to uninstall and reinstall node, npm & yarn with brew, but nothing change.

If I run npm install this is the error

../src/create_string.cpp:17:25: error: no matching constructor for initialization of 'v8::String::Utf8Value'
  v8::String::Utf8Value string(value);
                        ^      ~~~~~
/Users/MYPC/.node-gyp/12.1.0/include/node/v8.h:3002:5: note: candidate constructor not viable: no known conversion from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value'
      for 1st argument
    Utf8Value(const Utf8Value&) = delete;
    ^
/Users/MYPC/.node-gyp/12.1.0/include/node/v8.h:2995:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    Utf8Value(Isolate* isolate, Local<v8::Value> obj);
    ^
1 error generated.
make: *** [Release/obj.target/binding/src/create_string.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/MYPC/mysiteteam/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/Cellar/node/12.1.0/bin/node" "/Users/MYPC/mysiteteam/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/MYPC/mysiteteam/node_modules/node-sass
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN stylelint-webpack-plugin@0.10.5 requires a peer of webpack@^1.13.2 || ^2.7.0 || ^3.11.0 || ^4.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! **node-sass@4.9.4 postinstall: `node scripts/build.js`**
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.9.4 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/MYPC/.npm/_logs/2019-05-03T16_22_30_277Z-debug.log

So i'm trying to rebuild node-sass with this command line npm rebuild node-sass --force but the error it's the same!!!

More infos

MacOs Mojave Version 10.14.4

2,7 GHz Intel Core i7

npm -v

6.9.0

node -v

v12.1.0

yarn -v

1.15.2

package.json dependencies

  "devDependencies": {
    "autoprefixer": "~8.2.0",
    "browser-sync": "~2.24.7",
    "browsersync-webpack-plugin": "^0.6.0",
    "bs-html-injector": "~3.0",
    "buble-loader": "^0.4.1",
    "cache-loader": "~1.2.5",
    "clean-webpack-plugin": "^0.1.18",
    "copy-globs-webpack-plugin": "^0.2.0",
    "css-loader": "^0.28.9",
    "cssnano": "~4.0.5",
    "eslint": "~4.19.1",
    "eslint-loader": "~1.9",
    "eslint-plugin-import": "~2.14.0",
    "extract-text-webpack-plugin": "~3.0.2",
    "file-loader": "^1.1.6",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "imagemin-mozjpeg": "~7.0.0",
    "imagemin-webpack-plugin": "~2.2.0",
    "import-glob": "~1.5",
    "node-sass": "~4.9.4",
    "postcss-loader": "~2.1.0",
    "postcss-safe-parser": "~3.0",
    "resolve-url-loader": "~2.3.1",
    "rimraf": "~2.6",
    "sass-loader": "~6.0",
    "style-loader": "^0.22.1",
    "stylelint": "^8.4.0",
    "stylelint-config-standard": "~18.2.0",
    "stylelint-webpack-plugin": "^0.10.5",
    "uglifyjs-webpack-plugin": "^1.3.0",
    "url-loader": "^0.6.2",
    "webpack": "~3.10.0",
    "webpack-assets-manifest": "^1.0.0",
    "webpack-dev-middleware": "~2.0.4",
    "webpack-hot-middleware": "~2.22.3",
    "webpack-merge": "~4.1.4",
    "yargs": "~11.0.0"
  },
  "dependencies": {
    "jquery": "^3.3.1",
    "slick-carousel": "^1.8.1",
    "popper.js": "^1.14.7"
  }

What am I doing wrong?

解决方案

I'm using OSX latest version(10.14.4 (18E226)) and node 12.

While using node-sass 4.11, I had g++ error(../src/create_string.cpp:17:25: error: no matching constructor for initialization of 'v8::String::Utf8Value') while trying npm install, npm rebuild(link) which did not work.

I solved this by updating node-sass to 4.12(npm install node-sass), as the github issue on the node-sass says that support for node 12 is implemented in 4.12 version.

这篇关于Yarn - Node Sass 尚不支持我当前的环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,WP2

admin_action_{$_REQUEST[‘action’]}

do_action( "admin_action_{$_REQUEST[‘action’]}" )动作钩子::在发送“Action”请求变量时激发。Action Hook: Fires when an ‘action’ request variable is sent.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$_REQUEST['action']引用从GET或POST请求派生的操作。源码(Source)更新版本源码位置使用被使用2.6.0 wp-admin/admin.php:...

日期:2020-09-02 17:44:16 浏览:1158

admin_footer-{$GLOBALS[‘hook_suffix’]}

do_action( "admin_footer-{$GLOBALS[‘hook_suffix’]}", string $hook_suffix )操作挂钩:在默认页脚脚本之后打印脚本或数据。Action Hook: Print scripts or data after the default footer scripts.目录锚点:#说明#参数#源码说明(Description)钩子名的动态部分,$GLOBALS['hook_suffix']引用当前页的全局钩子后缀。参数(Parameters)参数类...

日期:2020-09-02 17:44:20 浏览:1060

customize_save_{$this->id_data[‘base’]}

do_action( "customize_save_{$this-&gt;id_data[‘base’]}", WP_Customize_Setting $this )动作钩子::在调用WP_Customize_Setting::save()方法时激发。Action Hook: Fires when the WP_Customize_Setting::save() method is called.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_data...

日期:2020-08-15 15:47:24 浏览:798

customize_value_{$this->id_data[‘base’]}

apply_filters( "customize_value_{$this-&gt;id_data[‘base’]}", mixed $default )过滤器::过滤未作为主题模式或选项处理的自定义设置值。Filter Hook: Filter a Customize setting value not handled as a theme_mod or option.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_date['base'],指的是设置...

日期:2020-08-15 15:47:24 浏览:885

get_comment_author_url

过滤钩子:过滤评论作者的URL。Filter Hook: Filters the comment author’s URL.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/comment-template.php:32610...

日期:2020-08-10 23:06:14 浏览:925

network_admin_edit_{$_GET[‘action’]}

do_action( "network_admin_edit_{$_GET[‘action’]}" )操作挂钩:启动请求的处理程序操作。Action Hook: Fires the requested handler action.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$u GET['action']引用请求的操作的名称。源码(Source)更新版本源码位置使用被使用3.1.0 wp-admin/network/edit.php:3600...

日期:2020-08-02 09:56:09 浏览:871

network_sites_updated_message_{$_GET[‘updated’]}

apply_filters( "network_sites_updated_message_{$_GET[‘updated’]}", string $msg )筛选器挂钩:在网络管理中筛选特定的非默认站点更新消息。Filter Hook: Filters a specific, non-default site-updated message in the Network admin.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分$_GET['updated']引用了非默认的...

日期:2020-08-02 09:56:03 浏览:854

pre_wp_is_site_initialized

过滤器::过滤在访问数据库之前是否初始化站点的检查。Filter Hook: Filters the check for whether a site is initialized before the database is accessed.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/ms-site.php:93910...

日期:2020-07-29 10:15:38 浏览:825

WordPress 的SEO 教学:如何在网站中加入关键字(Meta Keywords)与Meta 描述(Meta Description)?

你想在WordPress 中添加关键字和meta 描述吗?关键字和meta 描述使你能够提高网站的SEO。在本文中,我们将向你展示如何在WordPress 中正确添加关键字和meta 描述。为什么要在WordPress 中添加关键字和Meta 描述?关键字和说明让搜寻引擎更了解您的帖子和页面的内容。关键词是人们寻找您发布的内容时,可能会搜索的重要词语或片语。而Meta Description则是对你的页面和文章的简要描述。如果你想要了解更多关于中继标签的资讯,可以参考Google的说明。Meta 关键字和描...

日期:2020-10-03 21:18:25 浏览:1690

谷歌的SEO是什么

SEO (Search Engine Optimization)中文是搜寻引擎最佳化,意思近于「关键字自然排序」、「网站排名优化」。简言之,SEO是以搜索引擎(如Google、Bing)为曝光媒体的行销手法。例如搜寻「wordpress教学」,会看到本站的「WordPress教学:12个课程…」排行Google第一:关键字:wordpress教学、wordpress课程…若搜寻「网站架设」,则会看到另一个网页排名第1:关键字:网站架设、架站…以上两个网页,每月从搜寻引擎导入自然流量,达2万4千:每月「有机搜...

日期:2020-10-30 17:23:57 浏览:1295