node-sass更新我的NodeJS版本后,我遇到了一个问题.
问题 :
(node:472) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
C:\aglqng\src\main\webapp\node_modules\node-sass\lib\index.js:15
throw new Error(errors.missingBinary());
^
Error: Missing binding C:\aglqng\src\main\webapp\node_modules\node-sass\vendor\win32-x64-48\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x
Found bindings for the following environments:
- Windows 64-bit with Node 0.12.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Angular项目中将CSS变量与Sass函数一起使用(准确地说是lighten()/ darken()),据我所知,最新版本的LibSass允许它。
我已经安装node-sass@4.11.0和sass-loader@7.1.0(和角V7.3.0),但我却收到错误
参数$ color of lighten($ color,$ amount)必须是颜色
我想念什么吗?
谢谢!
我有以下结构:
node_modules
- my_component
- font
- scss
- my_component.scss
src
- my_app.js
- my_app.scss
Run Code Online (Sandbox Code Playgroud)
我正在尝试导入样式my_component.scss.该文件包含@font-face引用的声明../font/.所以类似于:
// my_component.scss
@font-face {
font-family: 'Helvetica Neue';
font-weight: $weight-medium;
src: url('../font/font-file.eot');
}
Run Code Online (Sandbox Code Playgroud)
在my_app.js我需要与之关联的SCSS文件.所以
// my_app.js
require('./my_app.scss');
//other app-specific code
Run Code Online (Sandbox Code Playgroud)
我是my_app.scss,我正在进口my_component.scss:
// my_app.scss
import 'my_component';
Run Code Online (Sandbox Code Playgroud)
并sassConfig设置为解析,node_modules/my_component/scss以便导入工作.
我的loader配置使用sass-loader,resolve-url-loader和css-loader.这是一个片段:
//loaders.js
loaders.push({
test: /\.scss$/,
loader: 'style!css?sourcemap!resolve-url!sass?sourceMap'
});
Run Code Online (Sandbox Code Playgroud)
这是我观察到的:
webpack-dev-server,url引用正确解析webpack使用相同的conf文件运行时,我进入 …我正在尝试通过运行安装node-sass v3.7.0npm install node-sass@3.7.0。安装一开始似乎工作正常,然后我反复收到此转储:
2 warnings generated.\n./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass_util.o.d.raw Stats {\n dev: 16777220,\n mode: 33188,\n nlink: 1,\n uid: 502,\n gid: 20,\n rdev: 0,\n blksize: 4096,\n ino: 30471085,\n size: 1472,\n blocks: 8,\n atimeMs: 1616683090000,\n mtimeMs: 1616683090000,\n ctimeMs: 1616683090200.791,\n birthtimeMs: 1616683090000,\n atime: 2021-03-25T14:38:10.000Z,\n mtime: 2021-03-25T14:38:10.000Z,\n ctime: 2021-03-25T14:38:10.201Z,\n birthtime: 2021-03-25T14:38:10.000Z }\n c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.3.6"' -I/Users/wvn179/.node-gyp/8.15.0/include/node -I/Users/wvn179/.node-gyp/8.15.0/src -I/Users/wvn179/.node-gyp/8.15.0/deps/openssl/config -I/Users/wvn179/.node-gyp/8.15.0/deps/openssl/openssl/include -I/Users/wvn179/.node-gyp/8.15.0/deps/uv/include -I/Users/wvn179/.node-gyp/8.15.0/deps/zlib -I/Users/wvn179/.node-gyp/8.15.0/deps/v8/include -I../src/libsass/include -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-threadsafe-statics -fno-strict-aliasing -MMD …Run Code Online (Sandbox Code Playgroud) 对不起,如果之前有人问过/已经回答过.我在谷歌上发现的类似问题要么有开门票,要么人们建议降级依赖关系.我不清楚为什么构建失败,它似乎在我的本地机器上正常工作.
感谢您的任何帮助,您可以提供!
Counting objects: 28, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (26/26), done.
Writing objects: 100% (28/28), 2.72 KiB | 0 bytes/s, done.
Total 28 (delta 19), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 4.1.1
remote: engines.npm (package.json): 2.14.4
remote:
remote: …Run Code Online (Sandbox Code Playgroud) 我想知道node-sass和gulp-sass之间有什么区别?每个版本的优缺点是什么?我在www.npmjs.com上看到,node-sass在下载方面的优势超过了一倍.这会让它变得更好吗?编译速度有区别吗?
我正在运行sudo npm run build,它说它找不到 sass 的绑定。我目前只安装了一个版本的 npm,它是 11.13.0
我试过
npm install node-sass,
npm rebuild node-sass,
npm uninstall -save node-sass,
npm install -save node-sass, 完全
npm cache clean删除 node 和 node_modules 文件夹,但仍然遇到相同的错误。然而,我确实安装了 8.0.0 版,但我使用 nvm 删除了它
ERROR in ./src/main/webapp/styles/styles.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/main/webapp/styles/styles.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Missing binding /home/dev/IdeaProjects/web-project/node_modules/node-sass/vendor/linux-x64-57/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
Found bindings for the following environments:
- Linux 64-bit …Run Code Online (Sandbox Code Playgroud) 我已经解决了有关此问题的所有问题,但似乎找不到任何可行的方法。
我收到此错误:-
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.11.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Run Code Online (Sandbox Code Playgroud)
我试图再次删除 node_modules 和 npm install。我还尝试删除 node_modules 中的 node-sass 文件夹,但 npm install -g node-sass@latest 也不起作用。我也试过
npm install -g node --unsafe-perm=true --allow-root
Run Code Online (Sandbox Code Playgroud)
和
npm uninstall node-sass
npm cache clean --force
npm install -g node-sass@latest …Run Code Online (Sandbox Code Playgroud) 尽管我是 React 和捆绑器(以及这两者的组合)的新手,但我正试图找到建立高效 Web 开发工作流程的方法。我的目标是让每个 React 组件使用自己的 SCSS 文件,其他组件的样式表无法访问该文件。但是,需要一些全局文件,例如 a variables.scss,这就是问题所在。
这是我的文件结构(来自 src 文件夹)此刻的样子:
??? assets
??? components
? ??? App
? ? ??? index.js
? ? ??? index.scss
? ??? Taskbar
? ? ??? index.js
? ? ??? index.scss
? ??? Window
? ??? index.js
? ??? index.scss
??? index.js
??? sass
??? mixins.scss
??? variables.scss
Run Code Online (Sandbox Code Playgroud)
我正在使用 Parcel 和 node-sass 来导入这些 SCSS 文件。如您所见,每个组件都有自己的文件夹,其中包含一个 SCSS 文件。
每个组件都像这样加载其指定的样式表:
import React from 'react';
import './index.scss';
import Taskbar from '../Taskbar';
export default …Run Code Online (Sandbox Code Playgroud) 我正在尝试运行以下两个命令:
npm install
npm audit fix
Run Code Online (Sandbox Code Playgroud)
在 VS Code 中,当报告以下错误时。
error C2664: 'v8::String::Utf8Value::Utf8Value(const v8::String::Utf8Value &)': cannot conver
t argument 1 from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value &
Run Code Online (Sandbox Code Playgroud)
非常感谢任何帮助解决这个问题!!