gpt4 book ai didi

node.js - npm install node-sass@3.7.0 生成 -Wrange-loop-analysis 问题

转载 作者:行者123 更新时间:2023-12-04 12:29:41 28 4
gpt4 key购买 nike

我正在尝试通过运行 npm install node-sass@3.7.0 来安装 node-sass v3.7.0 .安装似乎开始工作,然后我反复得到这个转储:

2 warnings generated.
./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass_util.o.d.raw Stats {
dev: 16777220,
mode: 33188,
nlink: 1,
uid: 502,
gid: 20,
rdev: 0,
blksize: 4096,
ino: 30471085,
size: 1472,
blocks: 8,
atimeMs: 1616683090000,
mtimeMs: 1616683090000,
ctimeMs: 1616683090200.791,
birthtimeMs: 1616683090000,
atime: 2021-03-25T14:38:10.000Z,
mtime: 2021-03-25T14:38:10.000Z,
ctime: 2021-03-25T14:38:10.201Z,
birthtime: 2021-03-25T14:38:10.000Z }
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 -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/sass_values.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/sass_values.o ../src/libsass/src/sass_values.cpp
In file included from ../src/libsass/src/sass_values.cpp:5:
In file included from ../src/libsass/src/eval.hpp:4:
../src/libsass/src/ast.hpp:1361:25: warning: loop variable 'numerator' of type 'const std::__1::basic_string<char>'
creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis]
for (const auto numerator : numerator_units())
^
../src/libsass/src/ast.hpp:1361:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent
copying
for (const auto numerator : numerator_units())
^~~~~~~~~~~~~~~~~~~~~~
&
../src/libsass/src/ast.hpp:1363:25: warning: loop variable 'denominator' of type 'const std::__1::basic_string<char>'
creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis]
for (const auto denominator : denominator_units())
^
../src/libsass/src/ast.hpp:1363:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent
copying
for (const auto denominator : denominator_units())
^~~~~~~~~~~~~~~~~~~~~~~~
&
我多次得到这个上面的转储。最后,返回此消息:
+ node-sass@3.7.0
added 21 packages from 43 contributors and audited 2105 packages in 121.004s`
好像已经安装好了。但是当我尝试使用我的应用程序时,我收到 node-sass 错误和 npm list -g node-sass表示该软件包未安装。它返回:
npm info it worked if it ends with ok
npm info using npm@6.4.1
npm info using node@v8.15.0
/Users/wvn179/.nvm/versions/node/v8.15.0/lib
└── (empty)
这是什么问题?如何成功安装 node-sass?

最佳答案

node-sass 有点过时了,我建议你改用 sass/sass-loader

npm install sass sass-loader

关于node.js - npm install node-sass@3.7.0 生成 -Wrange-loop-analysis 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66802037/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com