When running npm link (as per the multiple vague blog posts on the subject) on a private scoped packed, I am getting an E404 error.
This seems particularly odd considering the entire point of npm link is to sym-link local files. I do not understand why any request is being made.
Here are my commands;
$ cd /path/to/library
$ npm link
$ cd /path/to/my/project
$ npm link library
Which gives
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/library - Not found
npm ERR! 404
npm ERR! 404 'library@*' is not in this registry.
Anyway, I don't want to link to node_modules/library, the actual library is node_modules/@scope/library, so I also tried (in the project folder)
$ npm link @scope/library
Which gives a similar error
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@scope/library - Not found
npm ERR! 404
npm ERR! 404 '@scope/library@*' is not in this registry.
The scoped library is hosted on an internal repository, not the global npmjs repository, but I still don't understand why this request is being made since I want to link the local library changes to my local project.
Also, is there anything fundamentally different between using npm link and using ln -s myself?
So npm link relies on the details within the
package.jsonin the folder you initially runnpm linkTyping
npm -g listwill show that the library is linked using the name and version in the package.jsonSo the solution is simply to run the command with the name given in the global npm install list