添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Errors in dep 'string-width' after updating packages #1023

@serjo96

Description

At two project I found very strange problem, after update some packages bcrypt stars shoots in my project.
Idk what is problem, I was try to change node, remove and install bcrypt, but all same, if remove yarn.lock, bcrypt correct install, but after restart project I receive some error like at install.

error /project/node_modules/bcrypt: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments: 
Directory: /project/node_modules/bcrypt
Output:
/project/node_modules/wide-align/node_modules/string-width/index.js:2
const stripAnsi = require('strip-ansi');
Error [ERR_REQUIRE_ESM]: require() of ES Module /project/node_modules/strip-ansi/index.js from /project/node_modules/wide-align/node_modules/string-width/index.js not supported.
Instead change the require of /project/node_modules/strip-ansi/index.js in /project/node_modules/wide-align/node_modules/string-width/index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/project/node_modules/wide-align/node_modules/string-width/index.js:2:19) {
  code: 'ERR_REQUIRE_ESM'

node: 16.5 / 20.11.0 mac os Sonoma 14.2.1 (23C71) /docker with node.js
Global packages:

info "node-gyp@10.0.1" has binaries:
   - node-gyp
info "node-pre-gyp@0.17.0" has binaries:
   - node-pre-gyp