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)

当前回答

在我的情况下,问题是在节点的版本。由于我使用的是最新版本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开始

其他回答

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

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

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

如果你使用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兼容性的版本)

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

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

删除现有的:

npm uninstall --save-dev node-sass 

然后重新安装:

npm install --save-dev node-sass

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

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

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