yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

Unexpected error occurred: ENOTDIR: not a directory objects-11.0+.nib #7333

Open salmamali opened 5 years ago

salmamali commented 5 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior?

When updating the package instabug-reactnative , this error is encountered:

error An unexpected error occurred: "ENOTDIR: not a directory, lstat '<redacted>/node_modules/instabug-reactnative/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/objects-11.0+.nib'".

The only solution at the moment is to delete the node_modules folder and running yarn for a fresh install.

If the current behavior is a bug, please provide the steps to reproduce.

This issue was opened with more details on the environment. Install the package instabug-reactnative version 8.0.12 in a react native app and update to version 8.3.2 to reproduce this.

What is the expected behavior? Updating the package with yarn with no errors.

Please mention your node.js, yarn and operating system version. MacOSX Yarn: 1.16

DanielRuf commented 5 years ago

It seems the issue is that you have used a filename as directory name and yarn tries to install it over a file.

Compare the .nib directory for the chat at https://unpkg.com/instabug-reactnative@8.0.12/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/ with https://unpkg.com/instabug-reactnative@8.4.0/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/

leethree commented 5 years ago

I'm seeing the same issue. Yarn should overwrite the file with folder when install, instead it prints a cryptic error message. yarn install --force doesn't work either.

LaurensUP commented 3 years ago

This can also occur by messing with the yarn.lock file and changing the linkType of dependencies. If yarn thinks it's a soft link, but it should be a hard link, yarn will try to cd into a zip.

➤ YN0001: │ Error: ENOTDIR: not a directory, lstat '/home/laurens/code/*******/.yarn/cache/*******-12.76.2014-dec0f2fd0d-f799eeb192.zip/node_modules'
➤ YN0000: └ Completed in 2s 555ms
➤ YN0000: Failed with errors in 5s 387ms