4

I am trying to link a local dependency of scss styles to a project using npm link. Following the docs I run npm link in the dependencies directory, which tells me:

/usr/local/lib/node_modules/xxx/xyz -> /xxx/xxx/xxx/xxx/xxx/xyz

The I got to my project directory and run npm link xyz but it give the error:

npm ERR! 404 Not Found - GET https://registry.npmjs.org/xyz - Not found

So it is not finding the symlink and searching npm.

I have read that this can be caused by using nvm with different versions of node but this is not the case for me.

How can I successfully link the package?

Mr. Robot
  • 1,334
  • 6
  • 27
  • 79

1 Answers1

0

You can link the package manually:

pacakge.json
  "package": "package@*"
Project that requires the dependency

create a symbolic link to the local dependency

cd node_modules
ln -nfs ../relative/path/to/local/package
Wil Moore III
  • 6,968
  • 3
  • 36
  • 49