1.安装node.js到官网https://nodejs.org/en/download下载安装即可有windows的安装包2.安装yarn用npm可跳过npminstall--globalyarn报错npm : 无法加载文件 C:\Program Files\nodejs\npm.ps1因为在此系统上禁止运行脚本。有关详细信息请参阅 https:/go.microsoft.com/fwlink/?LinkID135170 中的 about_Execution_Policies。所在位置 行:1 字符:1 npm install --global yarn ~~~ ‘CategoryInfo : SecurityError: ( []PSSecurityExceptionFullyQualifiedErrorId : UnauthorizedAccess经查原因现用执行策略是 Restricted默认设置解决办法1.winX键使用管理员身份运行power shell2.输入命令set-executionpolicy remotesignedPS C:\Users\chencnpminstall--globalyarnadded1packagein6snpmnoticenpmnotice New minor version ofnpmavailable!11.12.1 -11.14.1npmnotice Changelog: https://github.com/npm/cli/releases/tag/v11.14.1npmnotice To update run:npminstall-gnpm11.14.1npmnoticePS C:\Users\chencyarn--version1.22.223.安装vue cliyarn global add vue/cli 或 npm i vue/cli -g我用的是npm i vue/cli -g安装后以下目录有vuePS C:\Users\chencnpmconfig get prefix C:\Users\chenc\AppData\Roaming\npm4.查看vue版本PS C:\Users\chencvue--versionvue/cli5.0.95.创建项目架子vue create $project-name (项目名-不能用中文)启动项目yarn serve或npm run serve (找package.json)以下是创建项目架子的自我操作✨ Creating projectinD:\cc_study\vue\vue\ccdemo01. Initializinggitrepository... ⚙️ Installing CLI plugins. This might take a while... added829packagesin42s109packages are lookingforfunding runnpmfundfordetails Invoking generators... Installing additional dependencies... added86packagesin8s121packages are lookingforfunding runnpmfundfordetails ⚓ Running completion hooks... Generating README.md... Successfully created project ccdemo01. Get started with the following commands: $cdccdemo01 $npmrun serve以下是运行项目的自我操作PS D:\cc_study\vue\vue\ccdemo01npmrun serveccdemo010.1.0 servevue-cli-service serve INFO Starting development server... DONE Compiled successfullyin9015ms23:03:49 App running at: - Local: http://localhost:8080/ - Network: http://192.168.1.34:8080/ Note that the development build is not optimized. To create a production build, runnpmrun build.
windows安装vue-cli
1.安装node.js到官网https://nodejs.org/en/download下载安装即可有windows的安装包2.安装yarn用npm可跳过npminstall--globalyarn报错npm : 无法加载文件 C:\Program Files\nodejs\npm.ps1因为在此系统上禁止运行脚本。有关详细信息请参阅 https:/go.microsoft.com/fwlink/?LinkID135170 中的 about_Execution_Policies。所在位置 行:1 字符:1 npm install --global yarn ~~~ ‘CategoryInfo : SecurityError: ( []PSSecurityExceptionFullyQualifiedErrorId : UnauthorizedAccess经查原因现用执行策略是 Restricted默认设置解决办法1.winX键使用管理员身份运行power shell2.输入命令set-executionpolicy remotesignedPS C:\Users\chencnpminstall--globalyarnadded1packagein6snpmnoticenpmnotice New minor version ofnpmavailable!11.12.1 -11.14.1npmnotice Changelog: https://github.com/npm/cli/releases/tag/v11.14.1npmnotice To update run:npminstall-gnpm11.14.1npmnoticePS C:\Users\chencyarn--version1.22.223.安装vue cliyarn global add vue/cli 或 npm i vue/cli -g我用的是npm i vue/cli -g安装后以下目录有vuePS C:\Users\chencnpmconfig get prefix C:\Users\chenc\AppData\Roaming\npm4.查看vue版本PS C:\Users\chencvue--versionvue/cli5.0.95.创建项目架子vue create $project-name (项目名-不能用中文)启动项目yarn serve或npm run serve (找package.json)以下是创建项目架子的自我操作✨ Creating projectinD:\cc_study\vue\vue\ccdemo01. Initializinggitrepository... ⚙️ Installing CLI plugins. This might take a while... added829packagesin42s109packages are lookingforfunding runnpmfundfordetails Invoking generators... Installing additional dependencies... added86packagesin8s121packages are lookingforfunding runnpmfundfordetails ⚓ Running completion hooks... Generating README.md... Successfully created project ccdemo01. Get started with the following commands: $cdccdemo01 $npmrun serve以下是运行项目的自我操作PS D:\cc_study\vue\vue\ccdemo01npmrun serveccdemo010.1.0 servevue-cli-service serve INFO Starting development server... DONE Compiled successfullyin9015ms23:03:49 App running at: - Local: http://localhost:8080/ - Network: http://192.168.1.34:8080/ Note that the development build is not optimized. To create a production build, runnpmrun build.