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)
当前回答
下面的代码适合我。
npm uninstall node-sass --legacy-peer-deps
npm install node-sass --legacy-peer-deps
其他回答
下面是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
如果问题存在,请升级或降级版本。
内包。Json转换node-sass版本:
"node-sass": "^4.0.0"
如果你使用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兼容性的版本)
答案从2022年开始。我的项目使用node-sass 4.14.1版本。不得不使用以下命令将我的节点降级到12.16.1版本:
npm install node@12.16.1
这解决了这个问题,并允许我再次使用webpack。
这条错误消息并不是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问题有很多关于这方面的信息。
推荐文章
- 有没有办法修复包锁。json lockfileVersion所以npm使用特定的格式?
- 如何使用npm全局安装一个模块?
- npm犯错!错误:EPERM:操作不允许,重命名
- Node Sass还不支持当前环境:Linux 64位,带false
- 编译typescript时'tsc命令未找到'
- npm不工作-“读取ECONNRESET”
- npm install from Git在特定的版本
- 顺序运行NPM脚本
- NPM卡住给出相同的错误EISDIR:对目录的非法操作,读取错误(本机)
- Browserslist: canius -lite已经过时。请运行下一个命令' npm update caniuse-lite browserslist '
- 检查已安装的angular-cli版本?
- 如何使webpack开发服务器运行在端口80和0.0.0.0使其公开访问?
- 如何在AWS Lambda中加载npm模块?
- 当我运行' npm install '时,它返回' ERR!代码EINTEGRITY ' (npm 5.3.0)
- 如何在Angular中显示应用版本?