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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章