【NPM】使用学习

转载:

目录

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

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

2、淘宝 NPM 镜像

3、vue-cli

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

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

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

prefix=D:\nodejs\node_modules\npm

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

 

相关文章:

  • 2021-09-06
  • 2021-10-28
  • 2021-12-24
  • 2022-01-03
  • 2021-10-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2021-06-02
相关资源
相似解决方案