标签: node-sass

NodeJS OSX 错误构建 node-sass

我正在运行 OSX 10.11.1 并尝试npm install在 package.json 中包含 node-sass 依赖项的项目:

“依赖关系”:{“节点sass”:“^3.4.2”}

我正在运行 NPM 版本 2.14.7 和节点版本 4.2.3。当我运行npm install或 npm 时,rebuild node-sass我得到以下错误输出:

> node-sass@2.1.1 postinstall /Users/markroper/code/mktg/node_modules/gulp-sass/node_modules/node-sass
> 节点脚本/build.js
gyp: /Users/markroper/.node-gyp/4.2.3/common.gypi 未找到 (cwd: /Users/markroper/code/mktg/node_modules/gulp-sass/node_modules/node-sass) 而读取包括绑定.gyp 尝试加载 binding.gyp 时
吉普错误!配置错误
吉普错误!堆栈错误:`gyp` 失败,退出代码:1
吉普错误!ChildProcess.onCpExit 上的堆栈(/Users/markroper/code/mktg/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/lib/configure.js:346:16)
吉普错误!堆栈在emitTwo (events.js:87:13)
吉普错误!ChildProcess.emit 上的堆栈 (events.js:172:7)
吉普错误!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
吉普错误!系统达尔文 15.0.0
吉普错误!命令 "/usr/local/bin/node" "/Users/markroper/code/mktg/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/bin/node-gyp" "重建"
吉普错误!cwd /Users/markroper/code/mktg/node_modules/gulp-sass/node_modules/node-sass
吉普错误!节点 -v v4.2.3
吉普错误!pangyp -v v2.3.3
吉普错误!不好
构建失败

有没有人用这些版本解决过这个错误?

node.js node-sass

8
推荐指数
2
解决办法
8859
查看次数

是否可以在安装后步骤中安装node-sass而无需从Github下载?

我在公司防火墙后面,用Nexus代理npm存储库.在安装后步骤中,node-sass尝试从https://github.com/sass/node-sass/releases/download/v3.10.1/linux-x64-48_binding.node卷曲, 但由于防火墙而失败.添加防火墙规则以让请求通过不是一种选择.如果也可以通过Nexus代理Github,这可能是一个选项,但是当我尝试时,我无法使该配置正常工作.

这也适用于Jenkins构建,因此让开发人员npm rebuild node-sass在安装失败后执行操作不是一个选项.我需要安装才能工作,否则Jenkins构建将失败.

是否有任何方法可以从npm注册表安装node-sass而无需在安装后步骤中从其他来源下载任何内容?

nexus node-sass

8
推荐指数
1
解决办法
4129
查看次数

在IBM i(以前称为iSeries/AS/400)上安装node-sass

有没有人能够在IBM i上成功安装node-sass?

我目前正在运行Node 6.9.1,并且能够安装许多npm软件包.但是,@ angular/cli依赖于node-sass,显然,node-sass有一个编译组件让我很难安装.

我的第一个问题与能够下载二进制文件本身有关 - 由于我们的网络设置,IBM i无法从以下位置下载二进制文件:

https://github.com/sass/node-sass/releases/download/v4.5.2/aix-ppc-48_binding.node

我收到超时错误.我能够通过将SASS_BINARY_SITE更改为非https版本来解决这个问题:

export SASS_BINARY_SITE='http://github.com/sass/node-sass/releases/download'
Run Code Online (Sandbox Code Playgroud)

但是,现在,即使二进制下载成功,当npm尝试测试二进制文件时,我会收到以下错误:

测试二进制二进制有一个问题:错误:无法加载模块/QOpenSys/QIBM/ProdData/OPS/Node6/lib/node_modules/node-sass/vendor/aix-ppc-48/binding.node.该模块具有无效的幻数.

at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at module.exports (/QOpenSys/QIBM/ProdData/OPS/Node6/lib/node_modules/node-sass/lib/binding.js:19:10)
at Object.<anonymous> (/QOpenSys/QIBM/ProdData/OPS/Node6/lib/node_modules/node-sass/lib/index.js:14:35)
Run Code Online (Sandbox Code Playgroud)

然后npm尝试在本地构建二进制文件,但由于Python2在此计算机上不可用而失败.我可以请求安装Python2,这在我们的环境中是一个漫长的过程,但在我继续关注那个兔子洞之前,我想知道实际上是否可以让node-sass工作,如果是的话,是否还有另一个二进制,我可以指向npm install使用而不是.

或者,是否有另一种获取node-sass工作的方法?

node.js ibm-midrange node-sass

8
推荐指数
1
解决办法
434
查看次数

在node-sass@4.7.2安装后脚本失败

我刚刚下载了最新版本的,node.js并且一直在尝试执行npm install我的一个项目,但是却说:

在node-sass@4.7.2安装后脚本失败。

我试着做:npm rebuild node-sass --force这也没做。

在此处输入图片说明

错误日志返回以下内容:

3209 warn angularfire2@5.0.0-rc.10 requires a peer of @angular/common@^6.0.0 
but none is installed. You must install peer dependencies yourself.
3210 warn angularfire2@5.0.0-rc.10 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
3211 warn angularfire2@5.0.0-rc.10 requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
3212 warn angularfire2@5.0.0-rc.10 requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. …
Run Code Online (Sandbox Code Playgroud)

sass node.js npm node-sass

8
推荐指数
3
解决办法
9016
查看次数

构建失败:`npm rebuild node-sass --force`

使用n切换节点版本。我碰到yarnnpm rebuild node-sass --force很多很多次。仍然失败。收到此错误:

Node Sass could not find a binding for your current environment

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
Run Code Online (Sandbox Code Playgroud)

有人知道如何解决吗?

另外..运行此命令时..

npm rebuild node-sass --force
Run Code Online (Sandbox Code Playgroud)

我知道了

npm WARN using --force I sure hope you know what you are doing.
Run Code Online (Sandbox Code Playgroud)

似乎什么也没做。

javascript node-sass

8
推荐指数
7
解决办法
1万
查看次数

SassError:媒体查询表达式必须以“(”开头

我有这个问题,即使我睡不着,伙计们

我的代码是这样的

<style lang="scss" scoped>
    @import '~/assets/scss/main.scss'
    .home_nav{
        nav {

        }
    }
</style>
Run Code Online (Sandbox Code Playgroud)

错误是

在此处输入图片说明

请有人帮助我

css sass node-sass vue.js sass-loader

8
推荐指数
1
解决办法
5295
查看次数

当我在汇总中使用 scss 时出现意外字符“@”(请注意,您需要插件来导入非 JavaScript 文件)

当我在汇总中使用 Scss 时,当我构建项目时出现错误:

[!] Error: Unexpected character '@' (Note that you need plugins to import files that are not JavaScript)
components/styles/index.scss (3:0)
1: @import 'variables';
Run Code Online (Sandbox Code Playgroud)

我尝试了一些方法但没有成功,例如rollup-plugin-postcssrollup-plugin-scss。我改为sassnode-sass但出现了另一个问题,因为我使用了类似的语法$spacer / 2

这是我的 package.json

[!] Error: Unexpected character '@' (Note that you need plugins to import files that are not JavaScript)
components/styles/index.scss (3:0)
1: @import 'variables';
Run Code Online (Sandbox Code Playgroud)

这是index.scss

  "devDependencies": {
    "@babel/core": "^7.18.6",
    "@babel/preset-env": "^7.18.6",
    "@babel/preset-react": "^7.18.6",
    "@babel/preset-typescript": "^7.18.6",
    "@rollup/plugin-babel": "^5.3.1",
    "@rollup/plugin-commonjs": "^22.0.1",
    "@rollup/plugin-json": "^4.1.0",
    "@rollup/plugin-node-resolve": …
Run Code Online (Sandbox Code Playgroud)

rollup sass node-sass

8
推荐指数
1
解决办法
1万
查看次数

如何确保node-sass和sass-loader版本兼容?

我的Nodejs版本是v16.16.0,npm版本是8.11.0。

在此输入图像描述

并且错误不断出现

在此输入图像描述

有什么办法可以升级 sass-loader 吗?(此外,当 npm runserve 运行时会出现此错误

语法错误:错误:Node Sass 版本 7.0.1 与 ^4.0.0 不兼容。)

node.js node-sass sass-loader

8
推荐指数
1
解决办法
1万
查看次数

更新到Node v4.0.0后运行gulp-sass时出错

我更新到Node v4.0.0,之后当我在我的项目中运行gulp时,我得到一个关于gulp-sass/node-sass的错误,如下所示:

错误:libsass未找到绑定.尝试重新安装node-sass

我试图删除项目中的所有节点模块并重新安装,我收到一些错误:

npm WARN package.json package@0.0.0没有存储库字段.

npm WARN package.json package@0.0.0没有许可证字段.

npm WARN弃用CSSselect@0.4.1:该模块现在可用作'css-select'

npm WARN弃用了CSSwhat@0.4.7:该模块现在可用作'css-what'

npm WARN弃用pangyp@2.3.2:使用node-gyp @ 3 +,它可以完成所有工作

-

node-sass@2.1.1 install/Users/Jonathan/Documents/sites/wkux/ct -html-lib/node_modules/gulp-sass/node_modules/node-sass

节点脚本/ install.js

无法从https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/darwin-x64-node-4.0/binding.node下载文件

node-sass@2.1.1 postinstall/Users/Jonathan/Documents/sites/wkux/ct -html-lib/node_modules/gulp-sass/node_modules/node-sass

node scripts/build.js

gyp:/Users/Jonathan/.node-gyp/4.0.0/common.gypi未找到(cwd:/ Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node -sass)在尝试加载binding.gyp时读取包含binding.gyp

gyp ERR!配置错误

gyp ERR!堆栈错误:gyp退出代码失败:1

gyp ERR!在ChildProcess.onCpExit堆栈(/Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/lib/configure.js:346:16)

gyp ERR!堆栈在emitTwo(events.js:87:13)

gyp ERR!在ChildProcess.emit堆栈(events.js:172:7)

gyp ERR!Process.ChildProcess._handle.onexit(internal/child_process.js:200:12)中的堆栈

gyp ERR!系统达尔文14.5.0

gyp ERR!命令"/ usr/local/bin/node""/ Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/bin/node-gyp ""重建"

gyp ERR!cwd/Users/Jonathan/Documents/sites/wkux/ct -html-lib/node_modules/gulp-sass/node_modules/node-sass

gyp ERR!node -v v4.0.0

gyp ERR!pangyp -v v2.3.2

gyp ERR!不好

构建失败

所有其他节点模块似乎都安装得很好.它与node-sass的东西在gulp-sass中引起了问题.

node.js gulp node-sass gulp-sass

7
推荐指数
1
解决办法
4433
查看次数

create-react-app(不弹出)+波本威士忌/整洁?

我正在重写一个使用Bourbon的"旧"React原型,它还在gulpfile中使用gulp-sass来注入一个节点整齐的依赖:

var sassOptions = {
    includePaths: require('node-neat').includePaths,
};
Run Code Online (Sandbox Code Playgroud)

我想使用create-react-app样板并通过使用npm脚本编译sass文件来为样式设置一个"简单"的工作流程(也因为create-react-app限制了你)但我无法弄清楚如何去做.

"build-css": "node-sass src/styles/ -o src/",
"watch-css": "npm run build-css && node-sass src/styles/ -o src/ --watch --recursive"
Run Code Online (Sandbox Code Playgroud)

我可能会在将来使用不同的方法重写样式(可能使用样式组件,可能继续使用Sass并完全忽略Bourbon)但我只需要从旧项目中移植Sass样式.

有关集成create-react-app(不弹出)和Bourbon/Neat的任何想法?

有没有办法将neat.includePaths位放入package.json中的node-sass单线程脚本中,例如?

neat bourbon node-sass create-react-app npm-scripts

7
推荐指数
1
解决办法
605
查看次数