CentOS8安装vue和vue-cli


安装vue

 '''

安装vue遇到警告

npm WARN saveError ENOENT: no such file or directory, open '/home/harold/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/harold/package.json'
npm WARN harold No description
npm WARN harold No repository field.
npm WARN harold No README data
npm WARN harold No license field.

'''

$ npm init -y
$ vi /home/harold/package.json

'''

{
  "name": "harold",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

'''

将description填上,然后在添加 private

'''

{
  "name": "harold",
  "version": "1.0.0",
  "description": "lgsp",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "private": true,
  "keywords": [],
  "author": "",
  "license": "ISC"
}

'''

$ npm install vue
$ npm list vue

 

安装vue-cli

$ npm config set registry https://registry.npm.taobao.org
$ npm config get registry
$ sudo npm install -g @vue/cli

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM