Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm publish module includes iOS framework. When npm install of that module, the iOS framework is corrupt

This is the strangest issue and only happens on one iOS framework in particular (that i noticed) within an npm module.

when clicking on the framework (before npm publish) I see:

frameworkname.framework
|
- Headers (dir)
- frameworkname
- Versions (dir)
    |
    -A (dir)
    -Current (dir)

I published this module to a private npm server. When I install the npm module the framework is corrupt. I see:

frameworkname.framework
|
- Headers (dir) MISSING
- frameworkname MISSING
- Versions (dir)
    |
    -A (dir)
    -Current (dir) MISSING

After reading http://www.raywenderlich.com/65964/create-a-framework-for-ios it looks like the missing files are symlinks. Has anyone else seen this behavior before? How do I keep the symlinks from being lost during the npm process?

like image 761
ldeluca Avatar asked Mar 31 '15 20:03

ldeluca


People also ask

Does npm publish run npm install?

By default, npm publish updates and npm install installs the latest tag. See npm-dist-tag for details about tags. [--access <public|restricted>] Tells the registry whether this package should be published as public or restricted. Only applies to scoped packages, which default to restricted .

How does npm publish work?

When you run npm publish , npm bundles up all the files in the current directory. It makes a few decisions for you about what to include and what to ignore. To make these decisions, it uses the contents of several files in your project directory. These files include .

Does npm publish Run build?

So, whenever you run npm publish command, the following scripts will run sequentially: npm test then npm run lint then npm run build and finally npm publish .


Video Answer


1 Answers

The missing files are symbolic links, and unfortunately, npm doesn't support symbolic links. As a workaround, you can replace the links with their targets (and remove the targets to prevent duplication).

E.g. for a framework FFF with the structure:

./FFF -> Versions/Current/FFF
./Headers -> Versions/Current/Headers
./Versions
./Versions/A
./Versions/A/FFF
./Versions/A/Headers
./Versions/Current -> A

you can run the following (in bash) from inside the framework directory:

framework=FFF && rm $framework Headers && mv Versions/A/{$framework,Headers} . && rm -rf Versions

to change the structure to:

./FFF
./Headers
like image 134
silyevsk Avatar answered Oct 19 '22 14:10

silyevsk