webpack -v
时间: 2023-09-29 15:10:03 浏览: 93
如果你在安装webpack后使用webpack -v命令无法显示webpack的版本号,这可能是因为webpack的全局安装没有成功。你可以尝试在package.json文件中配置webpack的命令脚本,然后使用npm start命令来运行webpack并查看版本号。
在package.json文件中,你可以在"scripts"字段下添加一个"start"命令,将webpack的配置文件路径作为参数传递给webpack命令。例如:
"scripts": {
"start": "webpack --config config/webpack.config.js"
}
然后,在项目根目录下运行npm start命令,这将会使用你在配置文件中定义的webpack配置来启动webpack,并且会显示webpack的版本号。
<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [输入webpack -v不显示webpack版本号](https://blog.csdn.net/weixin_54763080/article/details/129704607)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Webpack安装配置及打包详细过程](https://blog.csdn.net/weixin_30251587/article/details/101801404)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文