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