I'm still waiting for the company set up its account on NPM to allow me to use private modules.
Meanwhile, I'm making it work with npm + git private repos.
In order to reduce the friction when we finally switch to NPM private modules, I was willing to declare dependencies like:
{
"dependencies": {
"@company/repo": "git+https://<token>:x-oauth-basic@github.com/company/repo"
}
}
And then, in my code, do this:
import repo from '@company/repo'
However, when I run npm install
and inspect my node_modules/
, instead of finding something like:
node_modules
├── @company
│ └── repo
├── ...
The resulting structure is flat, there is no @company
folder:
node_modules
├── repo
├── ...
I couldn't find anything in the NPM docs about this behavior with git repos, so I want to know if this is a possible bug or if it's working as designed.