`npm install`在`git submodule update`失败

时间:2019-02-18 15:36:45

标签: react-native npm

我有一个带有本机反应的应用程序,托管在AWS CodeCommit上。

我已经在这个项目上工作了一段时间,但是在最近升级node&npm之后,我无法运行该应用程序。它卡在npm install处。这是错误-

npm ERR! code 1
npm ERR! Command failed: git submodule update -q --init --recursive
npm ERR! warning: templates not found in C:\Users\myComputer\AppData\Local\Temp\pacote-git-template-tmp\git-clone-c78347e9
npm ERR! warning: unable to access 'Examples/SDWebImage TV Demo/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/.gitattributes': Filename too long
npm ERR! warning: unable to access 'Examples/SDWebImage TV Demo/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/.gitattributes': Filename too long
npm ERR! error: unable to create file Examples/SDWebImage TV Demo/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json: Filename too long
npm ERR! warning: unable to access 'Examples/SDWebImage TV Demo/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/.gitattributes': Filename too long
npm ERR! error: unable to create file Examples/SDWebImage TV Demo/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json: Filename too long
npm ERR! warning: unable to access 'Examples/SDWebImage TV Demo/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/.gitattributes': Filename too long
npm ERR! warning: unable to access 'Examples/SDWebImage TV Demo/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/.gitattributes': Filename too long
npm ERR! error: unable to create file Examples/SDWebImage TV Demo/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json: Filename too long
npm ERR! warning: unable to access 'Examples/SDWebImage TV Demo/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/.gitattributes': Filename too long
npm ERR! error: unable to create file Examples/SDWebImage TV Demo/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json: Filename too long
npm ERR! Unable to checkout 'dc5c974b89509992d6c6e0d0510344fd0e35baa6' in submodule path 'ios/Vendor/SDWebImage'
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\myComputer\AppData\Roaming\npm-cache\_logs\2019-02-18T15_22_41_579Z-debug.log

Here是指向完整日志文件的链接。

如您所见,我正在Windows机器上工作。当我尝试在MacOS上构建应用程序时,它的运行情况非常好。 我尝试了不同版本的Node,NPM和Git,但错误仍然存​​在。

我怀疑这是Windows相关问题,但不知道如何解决。

1 个答案:

答案 0 :(得分:0)

好的。我找到了问题和解决方法。

问题是我们正在使用react-native-fast-image的分支版本,并且在执行npm-install时导致了错误。我克隆了存储库的分支,并将其在package.json中链接为-

"react-native-fast-image": "file:../react-native-fast-image",

代替-

"react-native-fast-image": "git+https://github.com/{account-name}/react-native-fast-image.git",

目前已经解决了这个问题。