Node.js 使用本地依赖项和package-lock.json安装Npm时抛出错误
我有一个三npm项目:Node.js 使用本地依赖项和package-lock.json安装Npm时抛出错误,node.js,npm,npm-install,Node.js,Npm,Npm Install,我有一个三npm项目: 带有下划线依赖项的项目a 带有下划线和本地依赖项的项目b 项目c带有下划线、a和b依赖项 我有一个为a、b和c项目运行npm安装的脚本 如果第一次运行脚本-确定 但是,如果删除所有node_模块文件夹,并按顺序运行npm install-c npm install会崩溃并出现错误: ENOENT npm ERR! syscall rename npm ERR! path D:\npm sample\c\node_modules\.staging\undersco
- 带有下划线依赖项的项目a
- 带有下划线和本地依赖项的项目b
- 项目c带有下划线、a和b依赖项
ENOENT
npm ERR! syscall rename
npm ERR! path D:\npm sample\c\node_modules\.staging\underscore-df67550f
npm ERR! dest D:\npm sample\a\node_modules\underscore
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'D:\npm sample\c\node_modules\.staging\underscore-df67550f' -> 'D:\npm sample\a\node_modules\underscore'
npm ERR! enoent This is related to npm not being able to find a file.
您可以下载脚本和项目
更新:
projecta中的package.json:
{
"version": "0.0.1",
"dependencies": {
"underscore": "1.8.3"
}
}
{
"version": "0.0.1",
"dependencies": {
"underscore": "1.8.3",
"a": "file:..//a"
}
}
{
"version": "0.0.1",
"dependencies": {
"underscore": "1.8.3",
"a": "file:..//a",
"b": "file:..//b"
}
}
projectb中的package.json:
{
"version": "0.0.1",
"dependencies": {
"underscore": "1.8.3"
}
}
{
"version": "0.0.1",
"dependencies": {
"underscore": "1.8.3",
"a": "file:..//a"
}
}
{
"version": "0.0.1",
"dependencies": {
"underscore": "1.8.3",
"a": "file:..//a",
"b": "file:..//b"
}
}
projectc中的package.json:
{
"version": "0.0.1",
"dependencies": {
"underscore": "1.8.3"
}
}
{
"version": "0.0.1",
"dependencies": {
"underscore": "1.8.3",
"a": "file:..//a"
}
}
{
"version": "0.0.1",
"dependencies": {
"underscore": "1.8.3",
"a": "file:..//a",
"b": "file:..//b"
}
}
更新
问题在这里解决-package.json文件上有什么内容?Bathiya,我更新了我的问题。您好,那么您到底想用这个设置实现什么?这可能有助于我们理解上下文。@MwamiTovi,我们有3个项目A、B、C。项目A依赖于B&C,项目B依赖于C。项目B&C是公共npm包。在本地开发中,我们希望将项目C中的项目B&C用作npm模块,但作为直接链接,以避免在代码更改时发布B&C(我们经常在那里进行更改)。package.json文件上有什么内容?Bathiya,我更新了我的问题。嗨,那么,您使用此设置到底想要实现什么?这可能有助于我们理解上下文。@MwamiTovi,我们有3个项目A、B、C。项目A依赖于B&C,项目B依赖于C。项目B&C是公共npm包。在本地开发中,我们希望使用项目C中的项目B&C作为npm模块,但作为直接链接,以避免在代码更改时发布B&C(我们经常在那里进行更改)。