安装vue过程 异常处理

在cmd中运行vue init wepack  hello将出现如下错误

 无法将“vue”项识别为 cmdlet、函数、脚本文件或可运行程序的名称' 或 'vue不是内部或外部命令'

重装步骤如下:

1.快捷键Win + R  输入cmd 打开命令提示窗口

2.运行 node -v  显示node版本号,运行 npm -v   显示npm版本号 代表node.js已安装。

3.运行 npm cache clean --force 清理缓存

        没有清理缓存会出现如下错误

       npm ERR! Unexpected end of JSON input while parsing near '...tarball":"https://reg'

4.运行 npm set registry https://registry.npmjs.org/  如无反应

运行淘宝镜像 npm install -g cnpm --registry=https://registry.npm.taobao.org

5.运行 npm install webpack -g 安装打包工具

6.运行 npm install vue-cli -g 安装vue脚手架

安装完成

运行 vue init webpack-simple hello 新建vue项目

 

vscode  运行 npm  vue 命令 提示 终端竟然无法识别npm和node?什么鬼!于是,去cmd里看了下,发现cmd里可以正常使用

需要:打开vs code属性里的兼容性,勾选以管理员身份运行,然后应用

 

解决VSCODE"因为在此系统上禁止运行脚本"报错:

以管理员身份运行vscode;
2. 执行:get-ExecutionPolicy,显示Restricted,表示状态是禁止的;
3. 执行:set-ExecutionPolicy RemoteSigned;
4. 这时再执行get-ExecutionPolicy,就显示RemoteSigned;

 

posted @ 2020-02-25 08:53  xiaofan20  阅读(152)  评论(0)    收藏  举报