【NPM】使用学习

【NPM】使用学习

转载:

目录

==============================================

1、修改 npm 模块的安装路径

2、淘宝 NPM 镜像

3、vue-cli

==============================================

1、修改 npm 模块的安装路径

在 npm 安装目录下找到 npmrc 文件,修改要安装的路径前缀

prefix=D: odejs ode_modules pm

2、淘宝 NPM 镜像

$ npm install -g cnpm --registry=https://registry.npm.taobao.org

删除

$ npm uninstall -g cnpm

3、vue-cli

$ npm install -g @vue/cli

删除

$ npm uninstall -g @vue/cli

创建工程

$ vue create my-project
# OR
$ vue ui

npm run XXX是执行配置在package.json中的脚本,比如:

"scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "analyz": "npm_config_report=true npm run build",
    "test:unit": "vue-cli-service test:unit",
    "test:e2e": "vue-cli-service test:e2e"
}

构建

npm run build

开发

npm run dev
原文地址:https://www.cnblogs.com/yangchongxing/p/10631364.html