How to overcome such behavior?

How to copy all NPM packages from Sinopia registry to a local NPM repository in Artifactory?

Kfir Avraham
In order to copy all the packages which stored in the Sinopia registry to a local NPM repository in Artifactory, you may follow a few simple steps as mentioned below:
Since all the packages stored in Sinopia located in $SINOPIA_HOME/storage/ directory, it is possible to copy them from this location to Artifactory following the steps below:
  1. Copy the $SINOPIA_HOME/storage/ directory to a machine which can reach Artifactory and has an NPM client installed (it should also be possible to work from the Sinopia host directly)

  2. Configure the ~/.npmrc file in order to deploy (pointing) to an NPM local repository in Artifactory (you may follow the ‘Set Me Up’ widget in Artifactory UI)

  3. Run the following command from the storage folder location mentioned in section #1 to get a file with a list of all the packages:
    $ find $SINOPIA_HOME/storage/ -name "*.tgz" > listOfPackages.txt

  4. Create a script to $npm publish all the NPM packages in the file with the list created above, for example:
    while read p; do
    echo $p
    npm publish $p
    done < listOfPackages.txt

By following the above steps, you should be able to migrate all the packages to Artifactory and from this point, it should be possible to $npm install the scoped packages which previously stored in Sinopia, directly from the local NPM repository in Artifactory.