E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj>ionic serve -l
(node:4772) 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.
There is an error in your gulpfile:
Error: Node Sass does not yet support your current environment: Windows 64-bit with false
For more information on which environments are supported please see:
TODO URL
    at Object.<anonymous> (E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj\node_modules\node-sass\lib\index.js:12:11)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj\node_modules\gulp-sass\index.js:187:21)
    at Module._compile (module.js:541:32)

这条错误消息并不是Ionic的问题,而是node-sass的问题,node-sass是在Gulp文件中指定执行的。

node-sass错误:

Node Sass还不支持当前环境

指示您试图运行的node-sass版本与已安装的node版本不兼容。

查看Node - Sass发布说明,了解您拥有的Node - Sass版本,了解需要哪个版本的Node。

如果node的版本错误,则必须降级node或升级node-sass,直到有兼容的对为止。如果节点版本被支持,你可能只需要运行:

npm rebuild node-sass

(如果全局安装node-sass,则使用-g)。

如果这不起作用,你可以:

npm uninstall node-sass && npm install node-sass

(同样,必要时使用-g)。

这个github问题有很多关于这方面的信息。

删除node_modules并运行npm install为我修复了这些错误。

其他人说:npm重建node-sass或npm审计修复可能会有帮助。

命令npm uninstall node-sass && npm install node-sass对我没有帮助,但在安装Python 2.7和Visual c++构建工具后,我删除了node_modules文件夹,从管理员打开CMD并运行npm install——msvs_version=2015。安装成功!

这条评论和这个链接也会有所帮助。

在我的情况下,问题是当我安装节点的最新版本,即;10.6.0. 同样的错误显示并参考@Quinn卸载该版本并安装8.11.3 LTS版本。现在工作很好:)

查看Node - Sass发布说明,了解您拥有的Node - Sass版本,了解需要哪个版本的Node。如果node的版本错误,则必须降级node或升级node-sass,直到有兼容的对为止。如果节点版本被支持,你可能只需要运行npm rebuild node-sass。如果这不起作用,你可以npm卸载node-sass或npm安装node-sass

试试这个:

npm --depth 9999 update
npm rebuild node-sass

我尝试了这个,但它不适合我,并抛出错误:

npm --depth 9999 update 
npm rebuild node-sass

我已经安装了最新的Node.js(目前是11.11.0 Current),在遇到这个问题后,我只是做了以下工作:

降级到推荐版本(目前是10.15.3 LTS) 你可以从NodeJS中获取, 删除node_modules和 然后重新安装纱线:

     yarn install
     yarn start

在执行这些命令之后,一切都运行正常。

NPM卸载node-sass && NPM安装node-sass是更好的解决方法

我也遇到过同样的问题,我是这样解决的:

检查当前项目中使用的node-sass版本 进入node-sass release: “https://github.com/sass/node-sass/releases/tag/v@.@.@”(把你的node-sass版本放在这里) 检查Supported Environment表,看看是否有你的Node版本 如果不是,请将节点版本降级到表中现有的最新版本

我知道这不是完美的解决方案,但我没有在我的情况下找到任何其他方法。

下面的堆栈跟踪链接帮助我解决了这个问题。

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.7.2

这个链接(https://github.com/sass/node-sass/releases/tag/v4.7.2)清楚地显示了所支持的节点版本。

    OS      Architecture    Node
    Windows x86 & x64       0.10, 0.12, 1, 2, 3, 4, 5, 6, 7, 8, 9
    ...     ...             ...    

将节点版本降级到8.11.1后,再次执行npm install。收到以下信息。

Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 8.x

Found bindings for the following environments:
  - Windows 64-bit with Unsupported runtime (64)

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.

最后,按照指示运行npm rebuild node-sass——force,一切都开始工作了

遇到这个问题,npm i @ionic/app-scripts是唯一工作的东西。

回滚到节点v10.17.0解决了我的问题。

你可以使用nvm来这样做:

https://github.com/nvm-sh/nvm

> nvm install 10.17.0
> nvm use 10.17.0
> node -v
10.17.0

我得到这个错误时,我更新节点使用NVM。 去掉这条线; NPM重建node-sass

以上这些方法对我都没用。我完全删除,然后重新安装,它解决了这个问题。

删除现有的:

npm uninstall --save-dev node-sass 

然后重新安装:

npm install --save-dev node-sass

对于visual studio 2019,需要更改MSBuild路径

npm config set msvs_version 2017

npm config set msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe"

npm rebuild node-sass

我用angular 7得到了这个错误,帮助我的是, 从windows power shell运行命令:

npm install --global --production windows-build-tools

然后我再次打开我的VS Code,在它的终端上运行相同的命令 NPM卸载node-sass并安装node-sass

在我的例子中,这与节点版本有关。

我的项目使用的是12.18.3,但我使用的是14.5.0

所以npm rebuild node-sass没有在错误的节点版本(14.5.0)上解决这个问题。

我切换到正确的版本(12.18.3),所以它可以工作。

内包。Json转换node-sass版本:

"node-sass": "^4.0.0"

下面是node和node-sass兼容版本列表。

NodeJS  Supported node-sass version *
Node    15        5.0+   
Node    14        4.14+ 
Node    13        4.13+, < 5.0   
Node    12        4.12+  
Node    11        4.10+, < 5.0   
Node    10        4.9+   
Node     8        4.5.3+, < 5.0  
Node  <  8   <    5.0     < 57

如果问题存在,请升级或降级版本。

我安装了最新的版本,在写这篇评论的时候是5.0.0

NPM安装node-sass@latest

我有一个类似的错误与sass包,我修复了以下步骤:

在确定错误是由于版本不兼容导致的之后,列出可用的版本:

npm view node-sass versions

我的版本是'5.0.0',所以我把它降级到之前的版本(在我的例子中是'4.14.1'):

npm uninstall node-sass

npm install node-sass@4.14.1

瞧,只需要一个版本步骤,在其他情况下可能需要几个,这取决于项目的年代或需求。

在我的情况下,问题是在节点的版本。由于我使用的是最新版本16.0.0,但node-sass的版本是旧的(4.14.1),我将节点降级为14.15.5 (nvm install 14.15.5),运行npm install node-sass@4.14.1,重建节点npm重建node-sass,然后启动我的应用程序npm start。成功了!

步骤:

NVM安装14.15.5(将节点降级到满足node-sass的版本) NVM使用14.15.5 NPM install node-sass@4.14.1(重新安装node-sass) NPM重建node-sass npm开始

以上解决方案都不工作,因为我在用npm rebuild node-sass或重新安装或卸载/安装重建node-sass时遇到了错误。

解决方案是将GCC (g++)版本升级到最新的7.3.1,而不是我之前安装的4.8.5。

旧的4.8.5不支持命令行选项'-std=c++14',该选项在安装时编译node-sass时使用。

所以只要升级gcc,然后使用任何解决方案与节点重建node-sass或任何其他上面提到的。

我把npm从6.4.12升级到7.14.0,这个错误消失了。然后我得到了另一个错误

错误:节点Sass版本5.0.0与^4.0.0不兼容。

我在这里找到了解决办法。我卸载了node sass 5.0.0并安装了4.14.1(显然这是node sass的最新4个版本,使用npm view node-sass versions命令进行了验证)。

这给了我一卡车的错误。 NPM安装node-sass@

4.14.1npm ERR! code 1
npm ERR! path /home/<subfolder>/commonreact/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
.. 2000 lines of Err ..
npm ERR! gyp ERR! cwd /home/<subfolder>/commonreact/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.2.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok 
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/<username>/.npm/_logs/2021-05-25T13_09_09_655Z-debug.log

然后我尝试了npm审计fix -force

就会得到这个错误

npm WARN audit No fix available for cp-cli@*
npm ERR! code ETARGET
npm ERR! notarget No matching version found for object-path@1.1.5.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

我检查了我的包裹。Json中有object-path: "0.11.4"

然后我尝试了npm install node-sass@4.0.0

在Ubuntu 20.04上,这个问题基本上陷入了地狱。我不应该升级到Ubuntu 20.04。

我会继续努力,并在这里报告我的发现。我有信心解决这个问题。

编辑 我将npm从7.14.0降级到6.14.12,npm start现在报告错误:Node Sass版本6.0.0与^4.0.0不兼容。我检查了npm node_sass -v报告6.14.12。我运行npm uninstall node-sass和npm install node-sass@4.14.1。

binding.target.mk:133: recipe for target 'Release/obj.target/binding/src/binding.o' failed
make: *** [Release/obj.target/binding/src/binding.o] Error 1
make: Leaving directory '/home/<subfolder>/commonreact/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/<subfolder>/commonreact/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Linux 4.15.0-143-generic
gyp ERR! command "/home/<subfolder>/.nvm/versions/node/v16.2.0/bin/node" "/home/<subfolder>/commonreact/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/<subfolder>/commonreact/node_modules/node-sass
gyp ERR! node -v v16.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.13.12 requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-class-static-block@7.14.3 requires a peer of @babel/core@^7.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/pickers@3.2.10 requires a peer of @date-io/core@^1.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.5.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

立即编辑工作 我遵循了这里的步骤,然后

节点-v -> 16.something

NVM install lts/erbium ->设置节点为12.22.1

NPM卸载node-sass

NPM安装node-sass@4.14.0

这个方法奏效了

我通过安装最新版本的python 2.7解决了这个问题。然后将包含python.exe文件的文件夹的路径添加到环境变量中。对我来说,路径是“C:\python27”,然后运行开始命令,它将工作。

这个问题很明显,因为gulp使用的是python 3。当它清楚地显示它使用python 2.7语法执行时,X版本。

import sys; print "%s.%s.%s" % sys.version_info[:3];

如果上述答案没有解决您的问题,请尝试一次

npm uninstall node-sass
npm install node-sass@4.14.1

来源:这里

这里的最佳解决方案是迁移到dart-sass,因为node-sass库已被弃用。

如果你使用NVM, VS Code和VS Code任务资源管理器来运行使用node-sass的npm脚本,下面的警告将为你节省一些时间。

I was using VS Code's Task Explorer to run my scripts and have installed multiple Node versions using NVM, defaulting to the current latest version 16. When I opened my VS Code repository and ran nvm use 10 in a new terminal, the Node and npm version in that terminal window correctly downgrades, but the version of node/npm used by the Task Explorer runner remained at Node 16. So when running my webpack script using the VS Code Task Runner, node-sass would still throw the environment error of this question.

解决方案是不使用VS Code任务运行器,在你改变节点版本的终端上运行你的脚本,或者使用下面的命令改变默认的NVM节点版本,重新启动VS Code,然后使用任务资源管理器/运行器。

NVM别名默认10(或任何你需要node-sass兼容性的版本)

如果你有一个用节点8构建的旧项目,你必须在节点8下运行:

$npm rebuild node-sass

然后切换到10号或以上节点,执行以下命令:

$npm uninstall node-sass && npm install node-sass

在这些行动之后,我一切都很好。如果我在节点8或节点10或更高的节点下执行此操作,则不会修复项目中的问题。 也许它会帮助别人:)

下面的代码适合我。试着在终端中使用这个

npm uninstall node-sass && npm install node-sass

如果你想要全局安装它,你可以添加-g

更新你的sass-loader应该会有神奇的效果。

npm i sass-loader@latest

使用Nodist节点版本管理器

如果使用nodist版本管理器,并且只设置了本地(文件夹)节点版本,则可能会出现此错误。

为此,需要将全局节点版本设置为与node-sass版本相匹配的版本。

如果没有其他方法,请尝试安装低版本的节点。

查找可用的节点版本

Brew搜索节点

安装低版本,如12

Brew install node@12

断开现有版本的链接

酿造断开节点

使用新版本

酿造链接node@12

如果你得到这样的警告:“警告:node@12是keg-only,必须与——force链接”

Brew link—force—overwrite node@10 echo 'export

更新您的配置并提供资源

PATH="/usr/local/opt/node@12/bin:$PATH"' >> ~/. "bash_profile源 ~ / . bash_profile

答案从2022年开始。我的项目使用node-sass 4.14.1版本。不得不使用以下命令将我的节点降级到12.16.1版本:

npm install node@12.16.1

这解决了这个问题,并允许我再次使用webpack。

下面的代码适合我。

npm uninstall node-sass --legacy-peer-deps
npm install node-sass --legacy-peer-deps

需要将节点降级至14版本:

npm install -g n
n 14
# if one of the commands does not pass, you may need to use sudo
sudo npm install -g n
sudo n 14

当使用Visual Studio中的任务运行器资源管理器时,确保你优先选择正确的PATH。

还要确保,一旦你改变优先级,重新启动VS。

$(PATH)指向默认节点路径 .\node_modules\.bin指向本地项目路径

因此,当您使用NVM切换节点版本时,您应该选择系统路径。