簡體   English   中英

npm使用嵌套項目結構重命名錯誤

[英]npm rename errors with nested project structure

我有一個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 

即使刪除package-lock.json和node_modules,它們仍然存在。 根據運行位置的不同, .staging/basic-auth-38c0f109部分最后會更改程序包名稱和哈希值。 我什至在Travis CI運行中也觀察到了此錯誤-https: //travis-ci.org/phylogeny-explorer/explorer/builds/488195843

更改根級別依賴項可以正常工作,沒有錯誤。

看起來像一些通天塔自動生成的東西,但我無法分辨出什么地方出了問題。

該項目的代碼位於https://github.com/phylogeny-explorer/explorer

這是https://github.com/npm/cli/pull/86修復的錯誤

如果遇到此問題,請將您的npm更新到v6.8.0-next.2。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM