NPM has recently introduced @scopes / organizations for the modules. Is there a good way to migrate existing modules to the organization? Are there any tools for automating it for a large number of packages? Does NPM support redirects, so that other software could still use the old name, yet get a notification that it should be updated?
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- Failed at the electron@1.8.2 postinstall script
- How to reimport module with ES6 import
- Webpack getting started, import error
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- Get file created date in node
You can change your package.json from:
to:
and publish the package:
Update: The
--access=public
argument is needed to make the scoped package public - otherwise it will be private by default. Instead of the command-line argument you can setaccess
to"public"
in thepublishConfig
section of yourpackage.json
:(Thanks to Danilo Bargen and Greg Pratt for pointing it out in the comments!)
See: https://docs.npmjs.com/getting-started/scoped-packages
The npm doesn't support redirects from old names to new names but you can deprecate the old package with:
So that people who install the old version would be notified that they should install another package instead.
See: https://docs.npmjs.com/cli/deprecate
Another way to do this that doesn't involve renaming the package, is to go to the team settings in your organization on the npm website (there's a default team called "developers"). There's a button there to add an existing package to the team.
This way you actually transfer the package, instead of republishing it under a different name.