微信小程序引入node_modules依赖

微信小程序不支持直接读取node_modules

首先在目录文件夹下cmd输入npm init命令

D:\小程序\project\calendar\calendar_1>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.
version: (1.0.0)
description:
entry point: (app.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to D:\小程序\project\calendar\calendar_1\package.json:{"name": "calendar_1","version": "1.0.0","description": "","main": "app.js","dependencies": {"accepts": "^1.3.8","agentkeepalive": "^4.5.0","ajv": "^6.12.6","arg": "^4.1.3","array-flatten": "^1.1.1","asn1": "^0.2.6","assert-plus": "^1.0.0","asynckit": "^0.4.0","aws-sign2": "^0.7.0","aws4": "^1.12.0","axios": "^0.21.4","base64-js": "^1.5.1","bcrypt-pbkdf": "^1.0.2","bignumber.js": "^9.0.0","bluebird": "^3.7.2","body-parser": "^1.20.1","bson": "^4.7.2","buffer": "^5.7.1","buffer-equal-constant-time": "^1.0.1","buffer-from": "^1.1.2","bytes": "^3.1.2","call-bind": "^1.0.5","caseless": "^0.12.0","clone": "^2.1.2","combined-stream": "^1.0.8","content-disposition": "^0.5.4","content-type": "^1.0.5","cookie": "^0.5.0","cookie-signature": "^1.0.6","core-util-is": "^1.0.3","dashdash": "^1.14.1","debug": "^2.6.9","define-data-property": "^1.1.1","delayed-stream": "^1.0.0","depd": "^2.0.0","destroy": "^1.2.0","diff": "^4.0.2","ecc-jsbn": "^0.1.2","ecdsa-sig-formatter": "^1.0.11","ee-first": "^1.1.1","encodeurl": "^1.0.2","escape-html": "^1.0.3","etag": "^1.8.1","express": "^4.18.2","extend": "^3.0.2","extsprintf": "^1.3.0","fast-deep-equal": "^3.1.3","fast-json-stable-stringify": "^2.1.0","finalhandler": "^1.2.0","follow-redirects": "^1.15.3","forever-agent": "^0.6.1","form-data": "^2.3.3","forwarded": "^0.2.0","fresh": "^0.5.2","function-bind": "^1.1.2","get-intrinsic": "^1.2.2","getpass": "^0.1.7","gopd": "^1.0.1","har-schema": "^2.0.0","har-validator": "^5.1.5","has-property-descriptors": "^1.0.1","has-proto": "^1.0.1","has-symbols": "^1.0.3","has-tostringtag": "^1.0.0","hasown": "^2.0.0","http-errors": "^2.0.0","http-signature": "^1.2.0","humanize-ms": "^1.2.1","iconv-lite": "^0.4.24","ieee754": "^1.2.1","inherits": "^2.0.4","ipaddr.js": "^1.9.1","is-regex": "^1.1.4","is-stream": "^2.0.1","is-typedarray": "^1.0.0","isarray": "^1.0.0","isstream": "^0.1.2","jsbn": "^0.1.1","json-bigint": "^1.0.0","json-schema": "^0.4.0","json-schema-traverse": "^0.4.1","json-stringify-safe": "^5.0.1","jsonwebtoken": "^8.5.1","jsprim": "^1.4.2","jwa": "^1.4.1","jws": "^3.2.2","lodash": "^4.17.21","lodash.clonedeep": "^4.5.0","lodash.includes": "^4.3.0","lodash.isboolean": "^3.0.3","lodash.isinteger": "^4.0.4","lodash.isnumber": "^3.0.3","lodash.isplainobject": "^4.0.6","lodash.isstring": "^4.0.1","lodash.merge": "^4.6.2","lodash.once": "^4.1.1","lodash.set": "^4.3.2","lodash.unset": "^4.5.2","long": "^4.0.0","make-error": "^1.3.6","media-typer": "^0.3.0","merge-descriptors": "^1.0.1","methods": "^1.1.2","mime": "^1.6.0","mime-db": "^1.52.0","mime-types": "^2.1.35","ms": "^2.1.3","mysql": "^2.18.1","negotiator": "^0.6.3","oauth-sign": "^0.9.0","object-inspect": "^1.13.1","on-finished": "^2.4.1","parseurl": "^1.3.3","path-to-regexp": "^0.1.7","performance-now": "^2.1.0","process-nextick-args": "^2.0.1","protobufjs": "^6.11.4","proxy-addr": "^2.0.7","psl": "^1.9.0","punycode": "^2.3.1","qs": "^6.5.3","range-parser": "^1.2.1","raw-body": "^2.5.1","readable-stream": "^2.3.7","request": "^2.88.2","request-promise": "^4.2.6","request-promise-core": "^1.1.4","retry": "^0.12.0","safe-buffer": "^5.1.2","safer-buffer": "^2.1.2","sax": "^1.3.0","semver": "^5.7.2","send": "^0.18.0","serve-static": "^1.15.0","set-function-length": "^1.1.1","setprototypeof": "^1.2.0","side-channel": "^1.0.4","source-map": "^0.6.1","source-map-support": "^0.5.21","sqlstring": "^2.3.1","sshpk": "^1.18.0","statuses": "^2.0.1","stealthy-require": "^1.1.1","string_decoder": "^1.1.1","tcb-admin-node": "^1.23.0","toidentifier": "^1.0.1","tough-cookie": "^2.5.0","ts-node": "^8.10.2","tslib": "^1.14.1","tunnel-agent": "^0.6.0","tweetnacl": "^0.14.5","type-is": "^1.6.18","typescript": "^5.3.2","undici-types": "^5.26.5","unpipe": "^1.0.0","uri-js": "^4.4.1","url": "^0.11.3","util-deprecate": "^1.0.2","utils-merge": "^1.0.1","uuid": "^3.4.0","vary": "^1.1.2","verror": "^1.10.0","wx-server-sdk": "^2.6.3","xml2js": "^0.4.23","xmlbuilder": "^11.0.1","yn": "^3.1.1"},"devDependencies": {},"scripts": {"test": "echo \"Error: no test specified\" && exit 1"},"author": "","license": "ISC"
}Is this OK? (yes)D:\小程序\project\calendar\calendar_1>npm installremoved 181 packages in 2mD:\小程序\project\calendar\calendar_1>

以上为cmd下操作过程,基本一路enter即可。

最后removed 181 packages in 2m是应为之前在calendar_1下就有node_modules。

然后到微信开发者工具下:

构建完成:

会生成如下文件夹:

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/195811.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

linux resin的安装

1. 下载安装包 1.1 下载地址&#xff1a;https://caucho.com/products/resin/download 这里我下载的是普通版本的resin&#xff0c;没有选resin pro 版本。 科普一下&#xff0c;从性能上来说 resin和resin pro 版本的性能没区别。 resin pro 版本的 和resin 普通版本的文件是…

无惧泄密:揭秘上海迅软DSE防拷贝大杀器!

对于企事业单位而言&#xff0c;文档的安全保护不仅要从源头上进行&#xff0c;杜绝文档在使用、传播过程中产生的泄密风险&#xff0c;同时也要对文档内容本身进行保护。为防止有心人通过拷贝、截屏、拍照等方式盗窃走重要文档内容信息的情况&#xff0c;天锐绿盾文件防泄密软…

HTTP 缓存机制

一、强制缓存 只要浏览器判断缓存没有过期&#xff0c;则直接使用浏览器的本地缓存而无需再请求服务器。 强制缓存是利用下面这两个 HTTP 响应头部&#xff08;Response Header&#xff09;字段实现的&#xff0c;它们都用来表示资源在客户端缓存的有效期&#xff1a; Cache…

Python基础快速过一遍

文章目录 一、变量及基本概念1、变量2、变量类型3、变量格式化输出4、type()函数5、input()函数6、类型转换函数7、注释 二、Python运算/字符1、算数运算2、比较运算3、逻辑运算4、赋值运算符5、转义字符6、成员运算符 三、判断/循环语句1、if判断语句2、while循环语句3、for循…

等保测评报价相差很大,里面有什么门道

等保测评报价的差异主要源于以下几点&#xff1a; 服务质量评估标准不同&#xff1a;不同的测评机构在测评过程中所提供的服务范围、深度、细节等方面可能存在差异&#xff0c;因此导致报价有所不同。一些机构可能提供全面且细致的测评服务&#xff0c;致力于提供高质量的等保测…

openGauss学习笔记-139 openGauss 数据库运维-例行维护-检查应用连接数

文章目录 openGauss学习笔记-139 openGauss 数据库运维-例行维护-检查应用连接数139.1 操作步骤139.2 异常处理 openGauss学习笔记-139 openGauss 数据库运维-例行维护-检查应用连接数 如果应用程序与数据库的连接数超过最大值&#xff0c;则新的连接无法建立。建议每天检查连…

一种结构新颖的双通带超导滤波器设计

闫鑫1,2&#xff0c;季来运1&#xff0c;张浩1,2&#xff0c;李颢毅1,2&#xff0c;王昭月1,2&#xff0c;曹凤莹1,2 &#xff08;1.天津海芯电子有限公司&#xff0c;天津300380&#xff1b;2.天津师范大学物理与材料科学学院&#xff0c;天津 300387.&#xff09; 摘要&…

前端dark主题的快速构建与切换

首先在全局css样式中增加一个 dark 模式即可&#xff0c;主要就是filter这个属性&#xff0c; invert(1);则表示100%完全反转样式&#xff0c;通俗点就是颠倒黑白&#xff0c;白的让它变成黑的&#xff0c;黑的让它变成白的。 css中的filter函数总结 filter:invert(1);数值范围…

Leetcode题库(数据库合集)_ 难度:简单

目录 难度&#xff1a;简单1. 组合两个表2. 第二高的薪水3. 第N高的薪水4. 分数排名5. 连续出现的数字6. 超过经理收入的员工7. 重新8. 寻找用户推荐人9. 销售员10. 排名靠前的旅行者11. 患某种疾病的患者12. 修复表中的名字13. 求关注者的数量14. 可回收且低脂的产品15. 计算特…

前后端参数传递总结

1、 页面参数 js传递参数 渲染表格 页面控制器&#xff08;前端&#xff09; 后端控制器 后端服务 实体赋值 2、跟踪情况

场景实践 | 法大大落地业财一体化,优化流程结构

2023 年&#xff0c;法大大作为中国电子签行业唯一上榜《2023胡润全球未来独角兽》企业&#xff0c;同时上榜“2022深圳市潜在科技独角兽企业榜单”。作为高速发展的高科技服务企业&#xff0c;法大大自2021年完成9亿元腾讯D轮融资后&#xff0c;建立了长期主义发展计划&#x…

计算机基础知识63

Django的条件查询&#xff1a;查询函数 exclude exclude&#xff1a;返回不满足条件的数据 res Author.objects.exclude(pk1) print(res) # <QuerySet [<Author: Author object (2)>, <Author: Author object (3)>]> order_by 1、按照 id 升序排序 res …

【Seata源码学习 】篇六 全局事务提交与回滚

【Seata源码学习 】篇六 全局事务提交与回滚 全局事务提交 TM在RPC远程调用RM后,如果没有出现异常&#xff0c;将向TC发送提交全局事务请求io.seata.tm.api.TransactionalTemplate#execute public Object execute(TransactionalExecutor business) throws Throwable {// 1. …

【离散数学】——期末刷题题库(集合)

&#x1f383;个人专栏&#xff1a; &#x1f42c; 算法设计与分析&#xff1a;算法设计与分析_IT闫的博客-CSDN博客 &#x1f433;Java基础&#xff1a;Java基础_IT闫的博客-CSDN博客 &#x1f40b;c语言&#xff1a;c语言_IT闫的博客-CSDN博客 &#x1f41f;MySQL&#xff1a…

【FPGA】Verilog:二进制并行加法器 | 超前进位 | 实现 4 位二进制并行加法器和减法器 | MSI/LSI 运算电路

Ⅰ. 前置知识 0x00 并行加法器和减法器 如果我们要对 4 位加法器和减法器进行关于二进制并行运算功能&#xff0c;可以通过将加法器和减法器以 N 个并行连接的方式&#xff0c;创建一个执行 N 位加法和减法运算的电路。 4 位二进制并行加法器 4 位二进制并行减法器 换…

内存是如何工作的

一、什么是内存 从外观上辨识&#xff0c;它就是内存条&#xff1b;从硬件上讲&#xff0c;它叫RAM&#xff0c;翻译过来叫随机存储器。英文全称&#xff1a;Random Access Memory。它也叫主存&#xff0c;是与CPU直接交换数据的内部存储器。其特点是读写速度快&#xff0c;不…

java开发之个微机器人的实现

简要描述&#xff1a; 二次登录 请求URL&#xff1a; http://域名地址/secondLogin 请求方式&#xff1a; POST 请求头Headers&#xff1a; Content-Type&#xff1a;application/jsonAuthorization&#xff1a;login接口返回 参数&#xff1a; 参数名必选类型说明wcId…

【每日一题】从二叉搜索树到更大和树

文章目录 Tag题目来源题目解读解题思路方法一&#xff1a;中序遍历的反序方法二&#xff1a;后缀数组 写在最后 Tag 【中序遍历】【二叉树】【2023-12-04】 题目来源 1038. 从二叉搜索树到更大和树 题目解读 在二叉搜索树中&#xff0c;将每一个节点的值替换成树中大于等于该…

根文件系统lib库添加与初步测试

一. 简介 我们在编译 busybox源码时&#xff0c;选择的是动态编译&#xff0c;所以&#xff0c;制作生成的 根文件系统中/bin或 /sbin目录下软件运行时会调用到一些库文件的。库文件就是交叉编译器的库文件。 前面我们编译 busybox源码时&#xff0c;选择动态编译&#xff0…

NPS内网穿透教程

1.简介 nps是一款轻量级、高性能、功能强大的内网穿透代理服务器。目前支持tcp、udp流量转发&#xff0c;可支持任何tcp、udp上层协议&#xff08;访问内网网站、本地支付接口调试、ssh访问、远程桌面&#xff0c;内网dns解析等等……&#xff09;&#xff0c;此外还支持内网ht…