QWhat is the difference between the configuration information of the dependencies in ChatGPTVue and the dependencies in devDependencies?

在运行项目的时候发现packag.json中"dependencies"和 "devDependencies"中依赖项的配置信息完全不同,如下图(以echarts举例),于是抱着好奇的心态去问了ChatGPT,不出所料,ChatGPT完美解答了我的疑问,GPT4.0就是这么强。

First, it explains

Generally speaking, the dependencies listed in"dependencies" dependencies listed "devDependencies"in

Then the solution is given


insert image description here

Supplement: View the version of a dependency installed in the project, but the ** package.jsonfile does not record the version information. The following two methods are introduced**

Method 1: Use the ** npm listcommand **

Open a terminal in the project's root directory and run the following command:

npm list [依赖项名称]

For example, if you want to see echartsthe version of , run:

npm list echarts

This will show the version installed echarts.

Method 2: Check the ​** node_modules​folder **

Another way is to directly check node_modulesthe ​folder to find the corresponding dependencies. Version information for a dependency is usually in a ​file in its subfolder package.json.

  1. Navigate to the project's node_modules​folder.
  2. Find the dependencies folder for which you want to view version information.
  3. Open that folder and find package.jsonthe ​file.
  4. In package.jsonthe ​file, find versionthe ​field. Version information for that dependency will be displayed here.

For example, for echarts, in node_modules/echarts/package.jsonthe file you can find version information.

ps: version information explanation

Guess you like

Origin blog.csdn.net/qq_46034741/article/details/130135491