微信小程序引入node_modules依赖

news2025/1/8 5:45:16

微信小程序不支持直接读取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 install

removed 181 packages in 2m

D:\小程序\project\calendar\calendar_1>

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

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

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

构建完成:

会生成如下文件夹:

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

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

相关文章

巧用乖离率BIAS,捕捉买卖信号

一、认识BIAS乖离率 BIAS&#xff0c;中文名称是乖离率&#xff0c;它表示一定时期内股价与其MA均线的偏离程度。这个指标的理论基础是如果股价偏离均线太远&#xff0c;不管股价在均线之上还是在均线之下&#xff0c;它最终都会向均线靠拢。 乖离率&#xff08;当日收盘价-N日…

德国进口高速主轴电机在机器人上的应用及选型方案

随着机器人技术的日新月异&#xff0c;高速主轴电机在机器人领域的应用也日趋广泛。德国进口的SycoTec高速主轴电机&#xff0c;以其高转速、高精度、高刚度的特点&#xff0c;在机器人的切割、铣削、钻孔、去毛刺等加工应用中发挥着关键作用。 一、高速主轴电机的特点 SycoT…

外汇天眼:想像巴菲特那样纵横市场?那你和他之间就差个它...

在金融市场上&#xff0c;有些人以巴菲特为榜样&#xff0c;希望像他一样纵横市场&#xff0c;成为投资大师。然而大多数人只是看到了巴菲特表面的成功&#xff0c;却忽视了他在投资过程中所付出的努力和智慧。实际上&#xff0c;如果你想成为像巴菲特那样的投资者&#xff0c;…

PPT NO.5 科研绘图常用操作快捷键

1、Ctrl键 ①按住Ctrl键&#xff0c;可以跳选多个对象&#xff1a; ②按住Ctrl键&#xff0c;同时拖动对象即可进行复制&#xff1a; ③按住Ctrl键&#xff0c;可以对对象进行中心放大或中心缩小&#xff1a; 2、Shift键 ①按住Shift键&#xff0c;拖动对象只能水平或垂直移动…

本地存储与复杂数据类型转换

1. 本地存储介绍 2.1 本地存储分类 - localStorage // 存储一个名字localStorage.setItem(uname, abc)// 获取名字console.log(localStorage.getItem(uname));// 删除本地存储 只删名字// localStorage.removeItem(uname)// 改localStorage.setItem(uname, aaa)// 存一个年龄 …

使用Linux docker方式快速安装Plik并结合内网穿透实现公网访问

文章目录 1. Docker部署Plik2. 本地访问Plik3. Linux安装Cpolar4. 配置Plik公网地址5. 远程访问Plik6. 固定Plik公网地址7. 固定地址访问Plik 本文介绍如何使用Linux docker方式快速安装Plik并且结合Cpolar内网穿透工具实现远程访问&#xff0c;实现随时随地在任意设备上传或者…

ApachePOI入门案例——向Excel文件写入内容

依赖 <dependency><groupId>org.apache.poi</groupId><artifactId>poi</artifactId><version>4.1.2</version> </dependency> <dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml…

无人机智慧工地:助力工地管理的未来之选

在现代工地管理中&#xff0c;无人机凭借其小巧、轻便和多角度拍摄等特点得到广泛应用&#xff0c;尤其在智慧工地的现场管理中发挥着重要作用。 一、无人机代替人工巡检省时省力 以往&#xff0c;施工现场检查主要依赖人工巡检方式&#xff0c;需要较长时间。而现在&#xff…

2312skia,skia简单绘画

#include <常用> #undef max #undef min //#include <ios> #include "亚定义" #include "sk0.cpp" 空 gg(亚画布&c){亚笔 p;p.置颜色(亚红色);亚字体 f;f.置大小(64);f.置字体(亚字族::从名造("楷体",亚字体风格::Normal()));//…

Golang使用Swagger文档教程

Golang开发效率是杠杠滴&#xff0c;简单几行代码就可完成一个可用的服务&#xff0c;如下代码&#xff1a; 采用Gin作为web framework采用Gorm作为持久化ORM采用Swagger作为OpenAPI文档管理工具 package mainimport ("encoding/csv""fmt""os"…

【AI读论文】CAAFE:基于大模型的自动特征工程

Title&#xff1a;Large Language Models for Automated Data Science: Introducing CAAFE for Context-Aware Automated Feature Engineering Paper: https://arxiv.org/pdf/2305.03403.pdf GitHub: https://github.com/automl/CAAFE PS&#xff1a;该论文已被NeurIPS 2023接收…

Windows系列:Windows的13个版本以及 Windows Server详解(配置)

Windows的13个版本以及 Windows Server详解&#xff08;配置&#xff09; 一. Windows的13个版本的区别&#xff0c;企业版、教育版、专业版、工作站版、SE版的主要区别家庭版专业版教育版企业版Servers版 二. Windows Server VS Windows&#xff0c;两者有啥区别&#xff1f;什…

ASP.NET 网上选课系统的设计与实现

1 系统设计与实现 1.1 数据库设计 为充分保护数据的一致性&#xff0c;数据库中各表都规范化设计&#xff0c;下图是系统数据库中使用的表以及各表之间的关系&#xff1a; 下面就各个表分别给出说明&#xff1a; (1)课程基本信息&#xff08;CourseInfo&#xff09;表&#x…

Typora免费版安装教程(仅供学习)

目录 一、Typora简介二、Typora安装三、Typora补丁四、Typora使用体验五、总结 一、Typora简介 Typora是一款非常流行的Markdown编辑器&#xff0c;它能够将Markdown文本转化为漂亮的排版&#xff0c;并且支持实时预览。Typora具有简单易用的界面&#xff0c;使得用户可以轻松地…

Pytorch CIFAR10图像分类 Swin Transformer篇

Pytorch CIFAR10图像分类 Swin Transformer篇 文章目录 Pytorch CIFAR10图像分类 Swin Transformer篇4. 定义网络&#xff08;Swin Transformer&#xff09;Swin Transformer整体架构Patch MergingW-MSASW-MSARelative position biasSwin Transformer 网络结构Patch EmbeddingP…

JAVAEE初阶相关内容第十六弹--网络原理之TCP_IP

目录 1. TCP-IP五层模型 2. UDP协议 2.1 特点 2.2 UDP协议端格式 2.3 校验和 3. TCP协议 3.1 特点 3.2 TCP协议段格式 3.2.1 首部长度 3.2.2 选项 3.2.3 保留6位 3.3 TCP内部的工作机制 3.3.1 确认应答 &#xff08;1&#xff09;应答报文ack &#xff08;2&…

elment-table设置el-table-column的label里面的文字换行居中显示

效果图如下&#xff1a; 直接上代码&#xff1a; <el-table class"ut-mt-2" row-key"company" default-expand-all:data"stateQuery.data" style"width: 100%":tree-props"{ children: departList, hasChildren: hasChildre…

使用基本ACL限制FTP访问权限示例

ACL简介 定义 访问控制列表ACL&#xff08;Access Control List&#xff09;是由一条或多条规则组成的集合。所谓规则&#xff0c;是指描述报文匹配条件的判断语句&#xff0c;这些条件可以是报文的源地址、目的地址、端口号等。 ACL本质上是一种报文过滤器&#xff0c;规则…

一起学docker系列之十八Docker可视化工具 Portainer:简介与安装

目录 前言1 简介2 安装过程2.1 创建docker容器数据卷2.2 构建运行protainer容器 3 Portainer 软件详细说明与界面导览3.1 查看本地Docker情况3.2 操作功能3.3 创建容器3.4 部署容器 4 Portainer的优势结语参考地址 前言 Docker作为容器化解决方案的热门工具&#xff0c;其可视…

C#/.NET/.NET Core优秀项目和框架2023年11月简报

前言 公众号每月定期推广和分享的C#/.NET/.NET Core优秀项目和框架&#xff08;公众号每周至少推荐两个优秀的项目和框架当然节假日除外&#xff09;&#xff0c;公众号推文有项目和框架的介绍、功能特点以及部分截图等&#xff08;打不开或者打开GitHub很慢的同学可以优先查看…