21.7 Node.js Development Environment
Last updated
Node.js depends on a specific version of /lib/libcrypto.so. Before installing on FreeBSD, the base system must be updated first.
Node.js installed via pkg depends on a specific version of the /lib/libcrypto.so.xxx file. When using Node.js on FreeBSD, you need to pay attention to the FreeBSD system version, especially when pkg is configured to use the latest repository.
Before installing Node.js on FreeBSD, the base system should be updated first.
Installing npm or yarn will automatically install the corresponding version of Node.js; Bun uses its own runtime and does not depend on Node.js.
Underlying language
JavaScript
JavaScript
Zig
Execution runtime
Node.js
Node.js
Native Bun Runtime
Dependency resolution
Flat dependency tree + hoisting
node_modules / Plug'n'Play (PnP)
High-concurrency install + flat node_modules
Disk storage strategy
Physical node_modules
node_modules or PnP virtual resolution
Global cache + hard link/clone optimization
Lock file
package-lock.json
yarn.lock
bun.lock
TypeScript support
Depends on tsc / tsx / esbuild etc.
Same as npm
Native .ts execution
Compatibility
Node.js official standard
High compatibility
Node API compatibility still needs improvement
Bun is a JavaScript runtime, not just a Node.js package manager.
Install using pkg:
Or install using Ports:
Install using pkg:
Or install using Ports:
Install using pkg:
Or install using Ports:
Set npm to use a domestic mirror to speed up downloads:
This site is the former Taobao mirror. For details, see https://npmmirror.com, which provides NPM Chinese mirror acceleration services.
If you skip updating the FreeBSD base system and install software directly, you may encounter the following error:
Note
The
libcrypto.so.111in the above error message corresponds to OpenSSL 1.1.1 (FreeBSD 13 and earlier). In FreeBSD 14, the base system's OpenSSL has been upgraded to 3.x, with the corresponding library file beinglibcrypto.so.30; in FreeBSD 15 and later, the corresponding library file islibcrypto.so.35. The error message will differ, but the root cause is the same: the base system needs to be updated first.
Ports compile based on the current system's library version, so installing via Ports compilation will not produce the above issue.
Last updated
pkg install bun# cd /usr/ports/lang/bun/
# make install clean# pkg install yarn# cd /usr/ports/www/yarn/
# make install clean# pkg install npm# cd /usr/ports/www/npm/
# make install clean# npm config set registry https://registry.npmmirror.com$ node # Start the Node.js interactive command line
ld-elf.so.1: /lib/libcrypto.so.111: version OPENSSL_1_1_1e required by /usr/local/bin/node not found