【发布时间】:2021-07-11 13:34:32
【问题描述】:
我正在尝试使用通常的方法将本地项目 testabc123 链接到 myproject:
cd testabc123
npm link
cd ../myproject
npm link testabc123
但是我收到了错误消息:
npm ERR! code E404
npm ERR! 404 Not Found - GET http://registry.npmjs.org/testabc123 - Not found
npm ERR! 404
npm ERR! 404 'testabc123@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
有什么想法吗?我链接本地项目的方法似乎很常见,大多数人都能成功。
【问题讨论】:
-
为什么要链接?测试模块?
-
testabc123是一个依赖项。我想编辑testabc123中的代码并将其反映在myproject(它使用该依赖项)中。 -
你还没有将你的模块发布到 npm,并且你正在尝试从那里获取?这就是问题所在。 registry.npmjs.org/testabc123 去搜索 npm 注册表。
-
试试
npm link ../testabc123 -
@ManishSoni 好的,但是这个网站上有很多答案告诉我完全按照我上面所做的那样做,而且这些答案有很多赞成票。我认为还有其他事情发生。
标签: javascript npm npm-link