What Is the Meaning of the "At" (@) Prefix on Npm Packages

What is the meaning of the at (@) prefix on npm packages?

This is a new feature of NPM called 'scoped packages', which effectively allow NPM packages to be namespaced. Every user and organization on NPM has their own scope, and they are the only people who can add packages to it.

This is useful for several reasons:

  • It allows organizations to make it clear which packages are 'official' and which ones are not.

    • For example, if a package has the scope @angular, you know it was published by the Angular core team.
  • The package name only has to be unique to the scope it is published in, not the entire registry.

    • For example, the package name http is already taken in the main repository, but Angular is able to have @angular/http as well.

The reason that scoped packages don't show up in public search is because a lot of them are private packages created by organizations using NPM's paid services, and they're not comfortable opening the search up until they can be totally certain they're not going to make anything public that shouldn't be public - from a legal perspective, this is pretty understandable.

For more information, see the NPM docs and the Angular docs.

EDIT: It appears that public scoped packages now show up properly in search!

What does npm: prefix in dependency section in package.json mean?

https://github.com/npm/cli/commit/b7b54f2d18e2d8d65ec67c850b21ae9f01c60e7e

this commit introduced aliasing to npm cli

Use of @ symbol in Node module names

So I solved this one myself.

Turns out @company/config is one of our private NPM repositories, hosted on npm and defined by this alias to an internal GitHub repository: it had nothing to do with how require works.

Using @ may or may not be a protocol that I was unaware of for private NPM repos, keep that in mind if you run into this.

Why do some npm packages start with @?

If a package's name begins with @, then it is a scoped package. The scope is everything in between the @ and the slash

@scope/project-name

How to Initialize a Scoped Package

To create a scoped package, you simply use a package name that starts with your scope.

{
"name": "@username/project-name"
}

More details, Please visit scoped package

and

What does "@" symbol mean in "import { Component } from '@angular/core';" statement?

npm run install with --prefix creates 'etc' folder

Production building script was running on another server so all npm scripts were blocked. After changing network path to physical (command: pushd \\serverpath) we were able to change directory and run npm freely. cd Scripts && npm run install did the work.



Related Topics



Leave a reply



Submit