我有一个NodeJS项目,其中嵌套子项目和它们自己的package.json。如果我更改子项目中的任何依赖项,我会得到如下错误:
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/home/travis/build/phylogeny-explorer/explorer/node_modules/.staging/user-api-9886b2c7/node_modules/basic-auth' -> '/home/travis/build/phylogeny-explorer/explorer/node_modules/.staging/basic-auth-38c0f109'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 即使删除了包-lock.json和node_modules,它们仍然存在。根据运行位置的不同,.staging/basic-auth-38c0f109部件最终会更改包名和散列。我甚至在Travis CI run - https://travis-ci.org/phylogeny-explorer/explorer/builds/488195843中也观察到了这个错误
更改根级别的依赖关系工作正常,没有任何错误。
它看起来像是巴别塔自动生成的东西,但我不知道出了什么问题。
发布于 2019-02-11 20:40:05
这是一个由https://github.com/npm/cli/pull/86修复的错误
如果遇到此问题,请将您的npm更新到v6.8.0-next.2。
https://stackoverflow.com/questions/54576619
复制相似问题