简体   繁体   English

npm使用嵌套项目结构重命名错误

[英]npm rename errors with nested project structure

I have a NodeJS project that has nested subprojects with package.json of their own. 我有一个NodeJS项目,其中嵌套了带有自己的package.json的子项目。 If I change any dependency in subprojects I get errors like this one: 如果我更改子项目中的任何依赖项,则会收到类似以下的错误:

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 

They persist even after removing package-lock.json and node_modules. 即使删除package-lock.json和node_modules,它们仍然存在。 Depending on where you would run, the .staging/basic-auth-38c0f109 part changes the package name and the hash in the end. 根据运行位置的不同, .staging/basic-auth-38c0f109部分最后会更改程序包名称和哈希值。 I have observed this error even in Travis CI run - https://travis-ci.org/phylogeny-explorer/explorer/builds/488195843 我什至在Travis CI运行中也观察到了此错误-https: //travis-ci.org/phylogeny-explorer/explorer/builds/488195843

Changing of the root level dependencies works fine with no errors. 更改根级别依赖项可以正常工作,没有错误。

It looks like some babel auto-generating thing, but I can't tell what's wrong. 看起来像一些通天塔自动生成的东西,但我无法分辨出什么地方出了问题。

Code of the project in question is at https://github.com/phylogeny-explorer/explorer 该项目的代码位于https://github.com/phylogeny-explorer/explorer

This was a bug fixed by https://github.com/npm/cli/pull/86 这是https://github.com/npm/cli/pull/86修复的错误

Update your npm to v6.8.0-next.2 if you experience this problem. 如果遇到此问题,请将您的npm更新到v6.8.0-next.2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM