【问题标题】:npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/easier-discordjs - Not foundnpm 错误!代码 E404 npm 错误! 404 未找到 - 获取 https://registry.npmjs.org/easier-discordjs - 未找到
【发布时间】:2021-09-06 06:10:03
【问题描述】:

您好,我正在制作我的第一个名为 easy-discordjs 的 npm 包,但是当我在主模块文件夹和测试模块文件夹中执行 npm 链接时,它会出错。

npm link easier-discordjs
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/easier-discordjs - Not found
npm ERR! 404  'easier-discordjs@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\niels\AppData\Local\npm-cache\_logs\2021-06-22T15_59_17_982Z-debug.log

我的主模块的 index.js 是这样的:

module.exports = (name) => {
    return `Hello ${name}!`;
};

我的测试模块的 index.js 是这样的:

const greeter = require('easier-discordjs');

console.log(greeter('Niels'))

我不知道该怎么办。

【问题讨论】:

    标签: node.js npm package npm-package


    【解决方案1】:

    NPM docs中所说,您必须先在easier-discordjs项目文件夹中执行命令npm link,然后在您的测试项目中执行npm link easier-discordjs

    诺西姆先生

    【讨论】:

      猜你喜欢
      • 2020-08-29
      • 2021-06-12
      • 2020-05-28
      • 2021-10-07
      • 1970-01-01
      • 1970-01-01
      • 2021-12-23
      • 2015-10-28
      相关资源
      最近更新 更多