Can someone help me in adding new npm package on NOVU project?
I want to add some npm package to application-generic for implementing sth.
So I just pnpm added <Package-Name>... BUT it shows these errors
Can anyone help me with this?
ERR_PNPM_FETCH_404 GET https://registry.npmjs.org/@novu%2Fdal: Not Found - 404
This error happened while installing the dependencies of @novu/[email protected]
@novu/dal is not in the npm registry, or you have no permission to fetch it.
No authorization header was set for the request.
../.. | Progress: resolved 611, reused 609, downloaded 0, added 0
5 Replies
Hi @MINIMINI, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* Add a new provider
* Monorepo Structure
* Windows
* Run Novu in local machine
-----------------------------
Answer
It seems that the error you're encountering is related to a dependency within the Novu project that can't be retrieved from the npm registry, specifically
@novu/dal
. This package is internal to Novu and isn't publicly available on npm. This is a common setup in monorepos, where internal packages are used across multiple projects within the same repository.
To resolve this issue, you should ensure that your local development environment is correctly set up to handle Novu's monorepo structure, which relies on internal links between packages rather than fetching all dependencies from npm. Here are a few steps you can follow:
1. Ensure you're using PNPM: Novu uses PNPM for managing dependencies, which handles symlinks and internal dependencies more efficiently in a monorepo setup. Make sure you have PNPM installed and are using it to install dependencies.
2. Run the Setup Script: If you haven't already, run the initial setup script provided by Novu. This script prepares the development environment, including linking internal packages. You can run this using:
This command sets up all required dependencies and ensures that internal packages like
@novu/dal
are properly linked and accessible across the monorepo (1) .
3. Check for Latest Changes: If you're working with a fork or a clone of the repository, make sure it's up to date with the main Novu repository. Sometimes, pulling the latest changes can resolve configuration issues causing these kinds of errors.
4. Environment Configuration: Ensure that your environment variables and configurations are set according to the requirements of the Novu project. Missing or misconfigured environment settings can lead to issues during package installation.
If you continue to experience issues after following these steps, it might be helpful to verify the local package links manually or check for additional configuration steps specific to the application-generic
package within the Novu documentation or community discussions.
Please attempt these steps, and if the issue persists, checking the Novu community forums or the documentation for any similar cases might provide further insights or solutions.Got it. Tagging @Support for additional help.
Hey @Moderator @Pawan Jain, can you help us out here?
@MINIMINI
Correct way to add npm package is
- Add that package in application-generic package.json as dependency
- run
npm run setup:project