NPM: After “npm link” module is not found

后端 未结 10 873
情深已故
情深已故 2021-02-11 11:31

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

10条回答
  •  情书的邮戳
    2021-02-11 12:30

    What worked for me was to:

    1. Delete the node_modules in both the dependency and the consumer module.
    2. Run npm unlink --no-save [dependency-module]
    3. re-link with the 2-link commands as per npm-link

    Now I am able to fully test my unpublished module locally.

    Additionally, there is an npm pack command which can help you test your unpublished modules, although not quite as robust.

    npm-pack

提交回复
热议问题