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)
当前回答
下面的堆栈跟踪链接帮助我解决了这个问题。
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 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 i @ionic/app-scripts是唯一工作的东西。
对于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
回滚到节点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
这里的最佳解决方案是迁移到dart-sass,因为node-sass库已被弃用。
推荐文章
- NodeJS -用NPM安装错误
- 如何为本地安装npm包设置自定义位置?
- 如何用分发文件发布npm包?
- 如何判断一个npm包是全局安装还是本地安装
- NodeJS需要一个全局模块/包
- 在MacOS X上推荐用什么方式安装Node.js、nvm和npm ?
- npm install和npm run build有什么区别?
- npm start和npm run start的区别
- 有没有办法修复包锁。json lockfileVersion所以npm使用特定的格式?
- 如何使用npm全局安装一个模块?
- npm犯错!错误:EPERM:操作不允许,重命名
- Node Sass还不支持当前环境:Linux 64位,带false
- 编译typescript时'tsc命令未找到'
- npm不工作-“读取ECONNRESET”
- npm install from Git在特定的版本