Vue-npm初始化项目具体操作(类似于java 的maven)

本文介绍如何使用npm快速创建项目并配置淘宝镜像加速依赖下载,包括npminit的用法和npminstall命令的详细介绍。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

笔记分享:

下载依赖的时候记得先配置Alibaba的地址,这样可以提高下载的速度:

npm config set registry https://registry.npm.taobao.org

install的node_modules目录

npm install

1、npm项目初始化操作 使用命令npm init

E:\vscode\vs1010\npmdemo>npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (npmdemo)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to E:\vscode\vs1010\npmdemo\package.json:

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


Is this OK? (yes) yes

项目初始化之后生成的文件:
在这里插入图片描述
这个文件类似于java的pom.xml文件

命令使用默认规则建包:

npm init -y

2、npm如何下载依赖

命令npm install 依赖名称

npm install jQuery
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

天元白手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值