§2024-09-23
-
試作機器: hc4Noble.yushei.net,
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
...
$ which fnm
/home/alexlai/.local/share/fnm/fnm
$ fnm --version
fnm 1.37.1
$ node --version
v20.17.0
$ npm --version
10.8.2
- DNS Setup, mx
$ dig hc4Noble.yushei.net mx
-
DNS Setup, spf
-
install haraka
$ sudo npm install -g Haraka
...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iconv@3.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iconv@3.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2024-09-23T07_13_12_406Z-debug.log
- use npm init
$ mkdir harakaMTA && cd $_
alexlai@hc4Noble:~/nodeProj/harakaMTA$
$ 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: (harakamta)
version: (1.0.0)
description: Haraka MTA
entry point: (index.js)
test command:
git repository:
keywords:
author: alexlai@yushei.net
license: (ISC)
About to write to /home/alexlai/nodeProj/harakaMTA/package.json:
{
"name": "harakamta",
"version": "1.0.0",
"description": "Haraka MTA",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "alexlai@yushei.net",
"license": "ISC"
}
Is this OK? (yes) yes
alexlai@hc4Noble:~/nodeProj/harakaMTA$ ls
package.json
$ cat package.json
{
"name": "harakamta",
"version": "1.0.0",
"description": "Haraka MTA",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "alexlai@yushei.net",
"license": "ISC"
}
$ npm i -s haraka
alexlai@hc4Noble:~/nodeProj/harakaMTA$ ls
node_modules package.json package-lock.json
$ cat node_modules/haraka/README.md
# haraka
This module name is inactive.
For [Haraka](https://haraka.github.io/) the mail server, use the name `Haraka` with a capital H.
For the React animations module, use `@exodus/haraka`.
$ npm uninstall haraka
removed 1 package, and audited 1 package in 2s
found 0 vulnerabilities
alexlai@hc4Noble:~/nodeProj/harakaMTA$ cat package.json
{
"name": "harakamta",
"version": "1.0.0",
"description": "Haraka MTA",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "alexlai@yushei.net",
"license": "ISC"
}