使用node-sass在Arch Linux上获取此错误.我正在使用gulp-sass.
Node Sass does not yet support your current environment: Linux 64-bit with false
Run Code Online (Sandbox Code Playgroud)
版本
$ gulp -v
[19:43:15] CLI version 3.9.1
[19:43:15] Local version 3.9.1
$ npm -v
3.9.0
Run Code Online (Sandbox Code Playgroud)
节点
$ node -v
v6.2.0
Run Code Online (Sandbox Code Playgroud)
即使使用此命令npm rebuild node-sass也不会改变任何内容.
我正在使用VS2015和Gulp.我打开Task Runner Explorer并点击刷新,这显示在日志中:
Failed to run "C:\Projects\Test\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
Error: `libsass` bindings not found in C:\Projects\Test\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-ia32-11\binding.node. Try reinstalling `node-sass`?
at Object.sass.getBinaryPath (C:\Projects\Test\node_modules\gulp-sass\node_modules\node-sass\lib\extensions.js:148:11)
at Object.<anonymous> (C:\Projects\Test\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:16:36)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Projects\Test\node_modules\gulp-sass\index.js:163:21)
at Module._compile (module.js:456:26)
Run Code Online (Sandbox Code Playgroud)
所以我尝试cmd.exe /c gulp --tasks-simple在PowerShell中运行,在同一目录中,它工作正常 - 它返回一个任务列表.
我也能很好地运行与SASS相关的任务,所以我不确定为什么在通过VS运行而不是直接在命令行上运行SASS时会抱怨它.
visual-studio gulp gulp-sass vs-2015-preview task-runner-explorer
我正在尝试从CSS模块导入主题,但TypeScript给我一个"无法查找模块"错误,并且主题未在运行时应用.我认为我的Webpack配置有问题,但我不确定问题出在哪里.
我正在使用以下工具:
"typescript": "^2.0.3"
"webpack": "2.1.0-beta.25"
"webpack-dev-server": "^2.1.0-beta.9"
"react": "^15.4.0-rc.4"
"react-toolbox": "^1.2.3"
"node-sass": "^3.10.1"
"style-loader": "^0.13.1"
"css-loader": "^0.25.0"
"sass-loader": "^4.0.2"
"sass-lint": "^1.9.1"
"sasslint-webpack-plugin": "^1.0.4"
Run Code Online (Sandbox Code Playgroud)
这是我的 webpack.config.js
var path = require('path');
var webpack = require('webpack');
var sassLintPlugin = require('sasslint-webpack-plugin');
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/dev-server',
'./src/index.tsx',
],
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: 'http://localhost:8080/',
filename: 'dist/bundle.js',
},
devtool: 'source-map',
resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js'],
},
module: {
rules: [{
test: /\.js$/,
loader: 'source-map-loader',
exclude: /node_modules/,
enforce: 'pre', …Run Code Online (Sandbox Code Playgroud) 我们是一个由大约6名开发人员组成的团队,他们使用异构设置(Windows 10,Ubuntu,macOS),并开始使用React进行开发.
Linux/macOS和Windows之间的脚本很痛苦,因此我们决定使用Bash for Windows来运行我们的构建.一旦你正确设置Bash,这很有效,并且与VS Code的集成非常好. 但是有一个很大的问题:每当你想要在Bash之外更新你的项目时(使用CMD或PowerShell),你就可以有效地切换你的操作系统,然后你从node-sass那里得到一个很好的错误,说你的环境有改变.
由于重建节点,青菜根本不会工作的,我们已经找到了唯一的办法摆脱这个问题被删除或重命名的node_modules和运行npm install一遍,但它是非常的时间/消耗资源.
我们已经看到它看起来有一个原生的js替代品,但我们想看看是否有人经历过相同的并找到了合适的解决方案.
我们真的没有大量的SASS文件,所以我们不太关心性能(这是使用libSass在C++中实现它的主要观点).
注:我们不能总是用猛砸在Windows上,因为我们有一些Java /有些凌乱的Maven集成阵营运行NPM构建的应用程序,这将永远是在Windows中.
我正在使用推荐的版本Node.js 10,只是试图运行一个简单的gulp任务来编译一些SCSS文件。但是,我收到以下错误。
Node Sass找不到您当前环境的绑定:具有Node.js 10.x的Windows 64位已找到以下环境的绑定:-具有Node.js 8.x的Windows 64位
这里完全错误
Failed to run "C:\Users\lee\Documents\Projects\Merch.Umb\Src\Merch.Web\Gulpfile.js"... cmd.exe /c gulp --tasks-simple C:\Users\lee\Documents\Projects\Merch.Umb\Src\Merch.Web\node_modules\node-sass\lib\binding.js:15
throw new Error(errors.missingBinary());
^ Error: Missing binding C:\Users\lee\Documents\Projects\Merch.Umb\Src\Merch.Web\node_modules\node-sass\vendor\win32-x64-64\binding.node Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x Found bindings for the following environments:
- Windows 64-bit with Node.js 8.x This usually happens because your environment has changed since running `npm install`. Run `npm rebuild node-sass` to download the binding for your current environment.
at module.exports …Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的节点应用程序停靠.我当前的应用程序是一个带有postgresql的nodejs express服务器.ExpressJS使用node-sass-middleware来处理sass资产.当我在我的OSX机器上本地运行node和postgresql时,一切正常.当我尝试运行应用程序时,docker-compose我收到"丢失绑定错误"
这是我的Dockerfile:
FROM node:7.2.1
RUN apt-get update -qq && apt-get install -y build-essential
RUN apt-get install -y libpq-dev postgresql-client
ENV APP_HOME /my_app
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
ADD package.json .
RUN npm install
RUN npm rebuild node-sass
ADD . .
CMD [ "npm", "start" ]
EXPOSE 3000
Run Code Online (Sandbox Code Playgroud)
这是我的docker-compose.yml档案:
version: '2'
services:
db:
image: postgres:9.6.1
ports:
- '5432:5432'
web:
build: . # use the Dockerfile next to this file
volumes:
- .:/my_app
ports:
- "3000:3000"
depends_on: …Run Code Online (Sandbox Code Playgroud) 我在 VS2017 中有一个基本的 gulp 设置来缩小我的 Javascript。我决定添加 gulp-sass (我的 package.json 说我在 gulp-sass v4.0.1 上)但它抛出了这个错误:
C:\Work\MyProject\MyProject\node_modules\gulp-sass\index.js:66
let sassMap;
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Work\MyProject\MyProject\gulpfile.js:11:12)
at Module._compile (module.js:397:26)
at Object.Module._extensions..js (module.js:404:10)
Run Code Online (Sandbox Code Playgroud)
我的 gulpfile 看起来像这样:
var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var watch = require('gulp-watch');
var …Run Code Online (Sandbox Code Playgroud) 我正在努力根据以下内容在docker容器中获取webpack开发服务器设置 node:latest
尽管尝试了Node Sass中的所有各种错误,都无法找到适合您当前环境的绑定,但我仍然遇到相同的错误:
web_1 | ERROR in ./~/css-loader!./~/sass-loader/lib/loader.js!./src/sass/style.sass
web_1 | Module build failed: Error: Missing binding /prject/node_modules/node-sass/vendor/linux-x64-59/binding.node
web_1 | Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 9.x
web
Run Code Online (Sandbox Code Playgroud)
这是当前
# Dockerfile
RUN yarn cache clean && yarn install --non-interactive --force
RUN rm -rf node_modules/node_sass
RUN npm rebuild node-sass
Run Code Online (Sandbox Code Playgroud)
重建步骤表明已安装二进制文件并签出:
Binary found at /advocate/node_modules/node-sass/vendor/linux-x64-59/binding.node
Testing binary
Binary is fine
Run Code Online (Sandbox Code Playgroud)
我也感到困惑的是
web_1 | Found bindings for the …Run Code Online (Sandbox Code Playgroud) node.js docker node-sass webpack-dev-server webpack-style-loader