terser not found. Since Vite v3, terser has become an optional dependency. You need to install it
时间: 2023-11-22 12:53:35 浏览: 561
这个错误提示是因为你在使用 Vite v3 或以上版本时,需要手动安装 terser 模块,否则会出现这个错误。你可以通过以下命令安装 terser:
```
npm install terser -D
```
或者
```
yarn add terser -D
```
安装完成后,再次运行你的项目即可。
相关问题
vite:terser] terser not found. Since Vite v3, terser has become an optional dependency. You need to install it.
As an AI language model, I do not have the capability to install packages or dependencies. However, you can install terser by running the following command in your terminal:
```
npm install terser -D
```
or
```
yarn add terser -D
```
This will install terser as a development dependency in your project.
[vite] Internal server error: Preprocessor dependency "sass" not found. Did you install it?
As an AI language model, I do not have the context of your project or the environment you are working on. However, based on the error message, it seems that you need to install the Sass preprocessor dependency. Sass is a popular preprocessor for CSS that allows you to use variables, functions, and other features that are not available in regular CSS.
To install Sass, you can use a package manager like npm or yarn. Here are the steps to install Sass using npm:
1. Open your terminal or command prompt.
2. Navigate to your project directory.
3. Run the following command: `npm install sass`
4. Wait for the installation to complete.
After installing Sass, try running your Vite server again and see if the error is resolved.
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)