标签: node-sass

当 npm 审核修复/更新/收缩包装手动更改不起作用时,如何更新 node-sass 的嵌套包 ansi-regex?

下面有完整的细分npm audit

\n

到目前为止,我们已经尝试了npm audit fix深度,我们已经尝试收缩并手动将相关版本号更改为 GitHub 建议的修复版本(6.0.1)。

\n

即使在手动删除、重新安装等之后,npm install 也会将软件包重置为 5.0.1。

\n

下面是 npm 审计的输出。

\n
     \xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xac\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x90\n    \xe2\x94\x82 Moderate      \xe2\x94\x82  Inefficient Regular Expression Complexity in                \xe2\x94\x82\n    \xe2\x94\x82               \xe2\x94\x82 chalk/ansi-regex                                             \xe2\x94\x82\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xbc\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xa4\n    \xe2\x94\x82 Package       \xe2\x94\x82 ansi-regex                                                   \xe2\x94\x82\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xbc\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xa4\n    \xe2\x94\x82 Patched in    \xe2\x94\x82 >=5.0.1                                                      \xe2\x94\x82\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xbc\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xa4\n    \xe2\x94\x82 Dependency of \xe2\x94\x82 node-sass                                                    \xe2\x94\x82\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xbc\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xa4\n    \xe2\x94\x82 Path          \xe2\x94\x82 node-sass > sass-graph > yargs > string-width > strip-ansi > \xe2\x94\x82\n    \xe2\x94\x82               \xe2\x94\x82 ansi-regex                                                   \xe2\x94\x82\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xbc\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xa4\n    \xe2\x94\x82 More info     \xe2\x94\x82 …
Run Code Online (Sandbox Code Playgroud)

node.js npm node-sass npm-install npm-audit

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

SassError:SassError:预期为“{”。在故事书里

我正在尝试使用 Storybook 来处理我的组件。我的组件使用 SASS 进行样式设置,但是当我启动故事书时,出现此错误:

\n
SassError: SassError: expected "{".\n  \xe2\x95\xb7\n2 \xe2\x94\x82 var content = require("!!../../../node_modules/css-loader/dist/cjs.js?modules&importLoaders!../../../node_modules/sass-loader/dist/cjs.js!./fileUpload.scss");\n  \xe2\x94\x82                                                                                                                                                              ^\n  \xe2\x95\xb5\n
Run Code Online (Sandbox Code Playgroud)\n

我的fileUpload.scss文件看起来非常良性。这是非常普通的 SCSS/CSS :

\n
nav {\n  .file-upload-modal {\n    min-width: 900px;\n  }\n\n  .file-upload-content {\n    min-width: 500px;\n  }\n}\n
Run Code Online (Sandbox Code Playgroud)\n

这个 SassError 错误试图告诉我什么?

\n

我的故事书main.js如下所示:

\n
module.exports = {\n  "stories": [\n    "../src/**/*.stories.mdx",\n    "../src/**/*.stories.@(js|jsx|ts|tsx)"\n  ],\n  "addons": [\n    "@storybook/addon-links",\n    "@storybook/addon-essentials",\n    "@storybook/preset-create-react-app",\n    // "@storybook/preset-scss",\n  ],\n  "framework": "@storybook/react",\n\n\n  webpackFinal: async (config, { configType }) => {\n    // add SCSS support for CSS …
Run Code Online (Sandbox Code Playgroud)

sass node-sass storybook

6
推荐指数
1
解决办法
7496
查看次数

npm 安装 npm 错误!gyp 动词 `which` 失败错误:未找到:python2

在 Ubuntu 21.10 上,实际上没有安装 Python2.x,在大型项目上执行“npm install”时,我遇到以下错误(很大,package.json但这两行可能相关:

...
  "devDependencies": {
    ...
    "sass": "^1.46.0",
    "sass-loader": "10.1.1",
...
Run Code Online (Sandbox Code Playgroud)

$ npm install

npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/username/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN old lockfile 
npm ERR! npm WARN old lockfile The package-lock.json file was created with an old version …
Run Code Online (Sandbox Code Playgroud)

node.js npm node-gyp node-sass npm-install

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

您可能需要一个额外的加载器来处理这些加载器的结果。角14

在删除项目中的所有错误后,我从 Angular 7 更新到 Angular 14,这是阻止我成功编译的唯一错误。我在 ng 服务上收到此错误:

/src/app/shared/styles/themes/theme-f.scss:1:6 - 错误:模块解析失败:意外的标记 (1:6) 文件已使用这些加载器处理:*/node_modules/resolve-url-loader /index.js */node_modules/sass-loader/dist/cjs.js 您可能需要一个额外的加载器来处理这些加载器的结果。正文,.wrapper > 部分 { | 背景颜色:#f5f7fa;| 颜色:#73879C;

这是我的 tsconfig.json 文件

{
  "compileOnSave": false,
  "compilerOptions": {
    "strictPropertyInitialization": false,
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "es2020",
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2019",
    "skipLibCheck": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "types": [ "googlemaps" ],
    "lib": [
      "es2018",
      "DOM",
      "DOM.Iterable",
      //"ScriptHost"
    ]
  },
  "angularCompilerOptions": {
    //"enableLegacyTemplate": true,
    //"enableI18nLegacyMessageIdFormat": false,
    "disableTypeScriptVersionCheck": true,
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true, …
Run Code Online (Sandbox Code Playgroud)

css loader node-sass angular angular14

6
推荐指数
1
解决办法
5153
查看次数

如何解决node-sass回归(?)"不清楚为@import导入哪个文件"

似乎最新版本的node-sass(3.4.1)打破了我们的构建.我一直收到此错误消息:

It's not clear which file to import for '@import "../file"'.
Candidates:
     ../file.scss
     ../file.css
Please delete or rename all but one of these files.
Run Code Online (Sandbox Code Playgroud)

现在,对于项目中未明确指定名称中的"file.scss"的所有文件,都会出现这种情况.

我无法确定这个错误的修复程序 - 我也找不到任何文档来解决node-sass导致它的变化.我们有太多文件可以重命名每个导入.

有人能指出我正确的方向吗?

编辑:

对于_file在其路径中具有下划线(例如.)的文件也会发生这种情况.似乎没有认识到这些文件是偏僻的.

gruntjs node-sass libsass

5
推荐指数
2
解决办法
4025
查看次数

在没有Python的情况下使用npm安装scss-lint

我正试图gulp-scss-lint在我的机器上工作,但是这样做有困难.

上下文

我有一种感觉特定的版本和环境设置可能对我的问题很重要,所以让我列出我的具体背景:

  • Windows Server 2012 R2标准版
  • NPM 2.14.7
  • 节点4.2.2
  • 已安装Gulp 3.9.0 -g
  • 从Powershell 4.0运行

摄制

这是我的问题的一个重复:

  1. mkdir gulpscsslintcd gulpscsslint
  2. npm init 所有默认答案
  3. npm install gulp --save-dev
  4. npm install gulp-scss-lint --save-dev
  5. new-item -itemtype file gulpfile.js 并输入:

    var gulp = require('gulp'), lint = require('gulp-scss-lint');
    gulp.task('default', [], function() {
      return gulp.src('*.scss').pipe(lint());
    });
    
    Run Code Online (Sandbox Code Playgroud)
  6. new-item -itemtype file styles.scss

  7. gulp

结果:

 [08:48:50] Using gulpfile ~\experiments\gulpscsslint\gulpfile.js
 [08:48:50] Starting 'default'...
 [08:48:50] 'default' errored after 32 ms
 [08:48:50] Error in plugin 'gulp-scss-lint' …
Run Code Online (Sandbox Code Playgroud)

npm gulp node-sass scss-lint

5
推荐指数
1
解决办法
1111
查看次数

Node Sass找不到当前环境的绑定:带有Node.js 6.x的Windows 64位

运行时出现以下错误消息gulp:

错误:缺少绑定Z:\ Themewagon\Premium\sparrow\zcore \node_modules \node-sass\vendor\win32-x64-48\binding.node节点Sass找不到当前环境的绑定:带有Node的Windows 64位.js 6.x

找到以下环境的绑定: Linux 64-bit with Node.js 7.x

要解决此错误,我试过:

  1. npm install node-sass,
  2. npm rebuild node-sass,
  3. npm uninstall -save node-sass,
  4. npm install -save node-sass,
  5. npm缓存清理.等等

没有什么对我有用.我该如何解决这个问题.

node.js gulp node-sass

5
推荐指数
1
解决办法
3983
查看次数

问题发生在node-sass和Docker上

我正在尝试将我的节点应用程序停靠.我当前的应用程序是一个带有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)

sass node.js docker node-sass docker-compose

5
推荐指数
2
解决办法
9485
查看次数

Node Sass No绑定您当前的环境

我在SO上看到了很多这样的问题,但似乎没有一个问题可以解决或匹配.
Node Sass找不到当前环境的绑定:带有Node.js 6.x的Windows 64位. 奇怪的是,我没有安装Node.js 6.x. 从命令行,节点-v给我v5.10.1.

我是开箱即用的Angular4 Universal Asp.net核心视觉工作室2017模板.

我试过了

  • npm rebuild node-sass --force
  • 在Visual Studio中的Web外部工具中重新排序节点

    失败:Microsoft.AspNetCore.Server.Kestrel [13]连接ID"0HL4JSD9SSV8E":应用程序抛出了未处理的异常.System.Exception:调用节点模块失败,错误:由于错误,预渲染失败:错误:模块构建失败:错误:缺少绑定D:\ Projects\angular2 \node_modules \node-sass\vendor\win32-x64-48\binding .node Node Sass找不到当前环境的绑定:带有Node.js 6.x的Windows 64位

    找到以下环境的绑定:

    • 带有Node.js 5.x的Windows 64位

    这通常是因为您的环境自运行以来发生了变化npm install.运行npm rebuild node-sass --force以构建当前环境的绑定.在Object的module.exports(D:\ Projects\angular2 \node_modules \node-sass\lib\binding.js:15:13).(d:\项目\ angular2 \node_modules \节点萨斯\ lib中\ index.js:14:35)

我哪里出错了?

visual-studio node.js npm node-sass

5
推荐指数
1
解决办法
4758
查看次数

我在docker上执行npm install时出现问题

在与同事一起工作时,在执行npm安装时我遇到了以下问题,尽管我的同事都没有遇到同样的问题.我们都使用docker环境,linux容器.

这是错误:

npm install
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0

> node-sass@4.9.3 install /var/www/node_modules/node-sass
> node scripts/install.js

fs.js:113
    throw err;
    ^

Error: …
Run Code Online (Sandbox Code Playgroud)

npm docker node-sass

5
推荐指数
1
解决办法
2882
查看次数