如何构建节点 5.4.0 npm 3.3.12 - 之前它运行良好

How to build node 5.4.0 npm 3.3.12 - earlier it was working fine

我们的应用程序是使用 node 5.4.0 和 npm 3.3.12 构建的。直到上周它工作正常。现在,当我们尝试 运行 命令 npm install 时,出现 npm 错误

38626 error node v5.4.0
38627 error npm  v3.3.12
38628 error code EMISSINGARG
38629 error typeerror Error: Missing required argument #1

我看到我需要将我的项目升级到最新的 npm。但这需要很多时间,因为我的项目依赖于 webpack 1 版本和旧库。我的问题是为什么它停止工作。我怎样才能解决这个问题?我正在附加 npm 日志。

    38619 verbose headers   'content-encoding': 'gzip' }
38620 silly get cb [ 200,
38620 silly get   { date: 'Thu, 28 May 2020 09:46:20 GMT',
38620 silly get     'content-type': 'application/json',
38620 silly get     'transfer-encoding': 'chunked',
38620 silly get     connection: 'keep-alive',
38620 silly get     'set-cookie': [ '__cfduid=de470fd6ae02fefdbbaf3cbeada2f984c1590659179; expires=Sat, 27-Jun-20 09:46:19 GMT; path=/; domain=.npmjs.org; HttpOnly; SameSite=Lax' ],
38620 silly get     'cf-ray': '59a70c3d493fc938-HYD',
38620 silly get     'cache-control': 'public, max-age=300',
38620 silly get     etag: 'W/"414ba14c1fef3e9df9d31821a3c138cf"',
38620 silly get     'last-modified': 'Sun, 26 Jan 2020 08:06:08 GMT',
38620 silly get     vary: 'accept-encoding, accept',
38620 silly get     'cf-cache-status': 'EXPIRED',
38620 silly get     'cf-request-id': '02fc45fa4f0000c9383abe1200000001',
38620 silly get     'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
38620 silly get     server: 'cloudflare',
38620 silly get     'content-encoding': 'gzip' } ]
38621 verbose get saving available-typed-arrays to /Users/thrinethrasiddani/.npm/registry.npmjs.org/available-typed-arrays/.cache.json
38622 verbose stack Error: Missing required argument #1
38622 verbose stack     at andLogAndFinish

问题很可能是更早的,但您是最后 week/today 才发现的。在 npm 3.5.2 上有 GitHub issue in npm repository 人 运行 抱怨同样的事情。简而言之,这似乎是一个 npm 错误,或者他们故意放弃了对旧 npm 版本的支持。该线程中的最后一条评论建议升级到最新的 npm 3.x,即 3.10.10,它似乎仍然有效。

据我所知,你只需要升级npm,而不是所有的依赖。但是,我确实建议尝试使您的依赖项保持最新以符合要求,拥有最新的安全修复程序和功能。

如果您想深入研究,this 就是抛出错误的地方。

更新: 有人找到了不需要 npm/node 升级的修复程序:https://askubuntu.com/a/1098249/162155