NPM: After “npm link” module is not found

后端 未结 4 1122
难免孤独
难免孤独 2021-02-11 11:36

I\'m developing two modules for NodeJS, first one named aligator and second one aligator-methods. Second one depends on first one to work. I\'m develop

4条回答
  •  清歌不尽
    2021-02-11 12:23

    When you first run npm link from the aligator directory, you create a link from your global node_modules directory to aligator. Then when you run the npm link aligator from the aligator-methods directory, you link aligator from your locally installed node_modules to the original source (as the output shows in your example above). Once this is done, there shouldn't be a need to install anymore since it's already "installed". What errors are you seeing after you run the npm link aligator command?

    If you just want to install a dependency from a local directory, you might just try using npm install instead. For example:

    $ cd ~/aligator-methods
    $ npm install ../aligator

提交回复
热议问题