vue init webpack ‘项目名称’ 运行报错

el/2023/12/3 3:14:56

Command vue init requires a global addon to be installed.
Please run npm install -g @vue/cli-init and try again.

创建项目需要将vue-cli进行去全局安装
使用命令:

npm install -g @vue/cli-init


http://www.ngui.cc/el/3419170.html

相关文章

yarn包管理器的使用

一,yarn的相关配置和查看 查看配置列表 yarn config list npm config npm 修改包的下载服务器地址,配置淘宝的镜像 yarn config set registry https://registry.npm.taobao.org 二.yarn的使用 1、yarn初始化一个项目(在项目目录下)&#xff1…

有关keep-alive缓存路由的各种用法

keep-alive基本用法 include - 字符串或正则表达式。只有名称匹配的组件会被缓存。 exclude - 字符串或正则表达式。任何名称匹配的组件都不会被缓存。 max - 数字。最多可以缓存多少组件实例。 主要用于保留组件状态或避免重新渲染。 <!-- 基本 --> <keep-alive>…

uni-app,Hbuilder编辑器中运行微信小程序开发者工具调试窗口,报错

首先感谢这位大神的分享&#xff0c;原地址在这&#xff1a; https://segmentfault.com/a/1190000023191861 解决方式&#xff1a; 打开微信开发者工具&#xff0c;找到设置的安全设置&#xff1a; 选择安全&#xff0c;启动服务端口

vuecli3.0 引入vant报错Cannot find module ‘babel-plugin-import‘ from

是因为没有安装 babel-plugin-import 运行命令 yarn add babel-plugin-import

Cannot read property ‘cancelToken‘ of undefined“

是因为在添加请求拦截器的时候&#xff0c;最后没有添加返回值return config方法 正确的写法应该是: axios.interceptors.request.use((config)>{ if(getStore(‘token’)){ config.headers.AuthorizationgetStore(‘token’); } return config; },(error)>{ console.log…

使用map的方式将数组中的对象,提取出来,转化成数组

如下&#xff1a; let imageList:[ { url:"first" }, { url:"second" } ] //这是第一种方法&#xff0c;是缩写 imageList.map(item>item.url); //第二种方法是全写 imageList.map((item)>{ return item.url; }) 输出的内容为&#xff1a;

uni-app实现多个图片预览

html的写法&#xff1a; <view > <image click"openImg(indexUrl,itemImg.url)" v-for"(itemImg,indexUrl) in info.images" class"w-100" mode"widthFix" :key"indexUrl" :src…

js中判断值的各种方式

//1.判断两个值是否相等 let v1,x2,s1; object.is(v,x) //false object.is(v,s) //true //2.判断json中是否包含某个键 let tt{xx:123,cc:‘3’’}; tt.xxd’’;’ tt.hasOwnProperty(‘xx’); //true tt.hasOwnProperty(‘xxd’);//true tt.hasOwnProperty(‘hasOwnProp…

@vue/cli卸载后安装新版本,无法卸载解决方式

今天更新vue/cli时&#xff0c;遇到问题&#xff1a;卸载不掉旧版本4.0 运行了npm uninstall vue/cli -g&#xff0c;之后&#xff0c;居然是up to date in,或者是显示删了很多文件&#xff0c;但是一运行 vue -V依然是可以查看版本的&#xff0c;说明没有卸载掉 以下方法可成…

VUE父级使用子组件以插槽的形式,在父级修改内容任意向子级插入

**父级组件的写法&#xff1a;** 子组件是firstSon <template> <div> <first-son> //向子组件中插入此内容 <div slot"firstcontent"></div> </first-son> </div&…