我想知道为什么我的 npm 只能通过完整路径/usr/bin/npm 工作并打开 npm 的代码,然后发现里面有一段奇怪的歌词。这是里面的代码。它实际上通过完整路径工作,但我担心它只是发送节点的人
npm.commands[npm.command](npm.argv, function (err) {
// https://genius.com/Lin-manuel-miranda-your-obedient-servant-lyrics
if (
!err &&
npm.config.get('ham-it-up') &&
!npm.config.get('json') &&
!npm.config.get('parseable') &&
npm.command !== 'completion'
) {
console.error(
`\n ${
npm.config.get('unicode') ? '🎵 ' : ''
} I Have the Honour to Be Your Obedient Servant,${
npm.config.get('unicode') ? '🎵 ' : ''
} ~ npm ${
npm.config.get('unicode') ? '📜🖋 ' : ''
}\n`
)
}
errorHandler.apply(this, arguments)
})
})
})()
最佳答案
这是 npm 代码中的彩蛋,请参阅 here和 here .
$ echo 'ham-it-up=true' > ~/.npmrc
$ npm help
... < help message > ...
🎵 I Have the Honour to Be Your Obedient Servant,🎵 ~ npm 📜🖋
关于linux - 在 node.js 脚本的 npm 内部进行拖钓的可能性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52589703/