首页 > 解决方案 > Laravel - 为什么节点模块加载器指的是不在我网站上的 node-sass 版本?

问题描述

我正在本地环境(MAC Sierra)上进行一些开发,当我的网站加载时,我不断收到此错误:

throw new Error("Module build failed: ModuleBuildError: Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (67)\nFor more information on which environments are supported please see:\nhttps://github.com/sass/node-sass/releases/tag/v4.5.3\n

我已阅读有关此错误的信息。我正在运行 node v 8.2.1 并根据我的操作系统环境将 node-sass 更新到 4.12。

在我的node_modules文件夹中,没有 4.5.3 版本的 node-sass 文件夹。即使我删除该node-sass文件夹,我仍然会收到此错误。如果我清除缓存,我仍然会收到此错误。我只是无法弄清楚这个 node-sass 4.5.3 将在 laravel 应用程序中的哪个位置加载。

我已经尝试重建 node-sass。关于这个问题,我已经尝试了十几种建议。但我的应用程序似乎仍然认为我有node-sass 4.5.3......

想法?

谢谢,布赖恩

标签: node.jslaravel

解决方案


你应该删除 node_modules 文件夹,packages-lock.json 文件然后运行:

npm cache clear --force 
npm install 
npm rebuild node-sass

推荐阅读