随笔分类 - Nodejs
摘要:npm 每次提示 onfig global --global, --local are deprecated. Use --location=global instead github上的Issues 原因 版本 v8.11 会出现这个问题 解决 升级到 v8.12.x
阅读全文
摘要:报错 libcrypto.so.1.1: cannot open shared object file: No such file or directory 完整报错信息 node:internal/modules/cjs/loader:1210 return process.dlopen(modu
阅读全文
摘要:nodemailer 官网 nodemailer 使用案例 使用案例 官方案例 email.js /* * @Description: 使用邮箱给对方发送邮件 * @Autor: Bowen * @Date: 2022-03-08 11:14:05 * @LastEditors: Bowen * @
阅读全文
摘要:官方文档 Blob File Buffer Buffer.from Buffer.from TypedArray ArrayBuffer 关系 继承关系 Buffer 是 node 中的类型 Buffer 继承于 Uint8Array Uint8Array 继承于 TypedArray (或者说是其
阅读全文
摘要:路径是否存在,不存在则创建 const path = require("path"); const fs = require("fs").promises; /** * 路径是否存在,不存在则创建 * @param {string} dir 路径 */ async function dirExist
阅读全文
摘要:创建一个 npm 账号 创建一个 npm 账号 本地添加账号 $ npm adduser npm notice Log in on https://registry.npmjs.org/ Username: username Password:xxx Email: (this IS public)
阅读全文
摘要:背景 因为一直在使用 hexo 自建博客,最近又切换到了 docusaurus ,但是又想同时发布到博客园,所以需要一个工具能将 md 文件直接发布到博客园,所以写了一个 node 自动化上传脚本 ,同时方便需要的人借鉴使用(2023年1月更新) 下面简单描述下 MetaWeblog 协议的使用 博
阅读全文
摘要:背景:使用 electron-builder 和 @journeyapps/sqlcipher 的项目 ,在新电脑上 clone 项目,npm 装包时遇到错误 一般 electron-builder 的项目下完包的最后,会调用 electron-builder install-app-deps 命令
阅读全文
摘要:文章原地址 前言 简单来说,node 是跨平台的,那么对于任何的 node 模块理论也是应该是跨平台的。然而,有些 node 模块直接或间接使用原生 C/C++代码,这些东西要跨平台,就需要使用源码根据实际的操作平台环境进行原生模块编译。SQLite3 就是一个经典的原生模块,让我们以安装该模块为例
阅读全文
摘要:node 搜索包的过程 在 node 中使用 require 函数直接通过名称导入的包的搜索过程 首先在当前目录下寻找 node_modules 中有没有当前导入的包 如果没有就在往上级找 node_modules,找到就使用 如果找到根目录还没有找到需要导入的包,就会报错 Buffer 缓存区 b
阅读全文
摘要:node 下包的过程 首先说下 node 下 需要预编译的包(例如node-sass)的过程 : node 下包首先会在线上找对应本地 node 版本和操作系统的包 有的无需系统支持就直接下 有的需要根据系统下对应的 tar.gz 包 用到 node-pre-gyp,如果找不到对应的 node 版本
阅读全文
摘要:版本的格式 major.minor.patch 主版本号.次版本号.修补版本号 ———————————————————— patch:修复 bug,兼容老版本 minor:新增功能,兼容老版本 major:新的架构调整,不兼容老版本 version 必须匹配某个版本 如:1.1.2,表示必须依赖 1
阅读全文
摘要:路径解析:path.resolve([from ...], to) 学习 webpack 遇到 path.resolve 但文档读完一遍很懵圈; 网上搜到一篇比较有用的文章 https://blog.csdn.net/kikyou_csdn/article/details/83150538 同时也给
阅读全文
摘要:本片文章转载于阮一峰老师的博客:http://www.ruanyifeng.com/blog/2016/10/npm_scripts.html Node 开发离不开 npm,而脚本功能是 npm 最强大、最常用的功能之一。 本文介绍如何使用 npm 脚本(npm scripts)。 一、什么是 np
阅读全文
摘要:ubuntu 安装 node 的三种方式 不推荐安装最新的 node 版本 好多 npm 包都没有对应的最新 node 版本的编译好的包 安装环境 本机系统:CentOS Linux release 7.5 Node.js:v12.18.1 获取 Node.js 安装包 Node.js 安装包及源码
阅读全文

浙公网安备 33010602011771号