gpt4 book ai didi

node.js - 更改 npm-debug.log 位置

转载 作者:IT老高 更新时间:2023-10-28 23:00:19 27 4
gpt4 key购买 nike

当我运行 npm start 并且出现一些错误时,它说:

npm ERR! Additional logging details can be found in:
npm ERR! /home/hsz/Projects/project/npm-debug.log
npm ERR! not ok code 0

这个文件位于我调用 npm 的目录中。

是否可以将 npm-debug.log 输出文件设置为 ./logs/npm-debug.log

最佳答案

更新:

npm pull request #6744尝试将 npm-debug.log 从 cwd 移动到缓存文件夹中。


原答案:

似乎没有办法做到这一点。它是硬编码的:

error-handler.js

if (wroteLogFile) {
log.error("", [""
,"Additional logging details can be found in:"
," " + path.resolve("npm-debug.log")
].join("\n"))
wroteLogFile = false
}
log.error("not ok", "code", code)

还有 other occurrences as well .

我认为这种灵 active 不符合 npm 的理念,请参阅 isaacs comment :

npm config set prefix?

If you want to spell "node_modules" differently, sorry, no can do. That's built into node-core. Changing that is tantamount to building a completely different package manager.

关于node.js - 更改 npm-debug.log 位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21624030/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com