npm install -s jquery 安装好jQuery
为什么package.json文件里没显示该依赖啊?
{
"name": "simple-app-demo",
"version": "1.0.0",
"description": "node demo",
"main": "index.js",
"scripts": {
"build": "webpack app.js bundle.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Hanger",
"license": "ISC"
}
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你需要在安装的时候加上参数--save或--save-dev。
你可以在你的命令行工具输入npm install --help,就可以知道它怎么用。
更具体的你可以查文档
npm i -S jqueryS 需要大写的
npm install -S jqueryS是要大写的,或者写成npm install --save jquery这里是小写npmm install xxx --save(-dev)