unanticipated installation issue with published npm package on verdaccio

I am on a mission to create and release a package containing commonly used TypeScript functions on Verdaccio, an npm registry that operates on Docker.

After completing the build for my TypeScript package, this is how my project structure looks:

https://i.sstatic.net/3c7Ur.png

The important elements from my package.json file are:

    {
  "name": "communications",
  "version": "1.0.0",
  "description": "provides functional way of interacting with NATS",
  // More details...
  "dependencies": {
    "nats": "^2.9.2"
  }
}

Regarding my tsconfig.json settings:

{
  "compilerOptions": {
    /* Various compiler options mentioned... */
  },
   "include": ["src"],
   "exclude": ["node_modules", "**/__tests__/*"]
}

In the .npmignore file, I specify:

package-lock.json
node_modules/

This is what my lib structure looks like post the tsc execution:

https://i.sstatic.net/n2Wnq.png

Despite successfully publishing the project in Verdaccio, when attempting to install it using:

npm install communications --registry http://localhost:4873/ 

I encounter issues where only the package.json file gets downloaded without any other contents. This leads to compilation errors due to missing import files.

I wonder why the lib folder is omitted completely from the npm package - any insights?

That's all for now.

Answer №1

My approach was on point until I realized that I had overlooked a crucial command.

npm pack 

This command creates a compressed package called communication.nats-1.0.0.tgz, which needed to be published in order for me to access all the necessary files. It turned out to be a simple oversight, and surprisingly, the tutorial I followed failed to mention this step. The correct sequence should have been:

tsc
npm pack
npm publish --registry="path-to-custom-registry:port"

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using Typescript: Utilizing only specific fields of an object while preserving the original object

I have a straightforward function that works with an array of objects. The function specifically targets the status field and disregards all other fields within the objects. export const filterActiveAccounts = ({ accounts, }: { accounts: Array<{ sta ...

Tips on personalizing the FirebaseUI- Web theme

Can someone help me find a way to customize the logo and colors in this code snippet? I've only come across solutions for Android so far. if (process.browser) { const firebaseui = require('firebaseui') console.log(firebaseui) ...

Course completed following the module

As a newcomer to Angular, I am facing an issue with saving data in a class and reading it into a component. It seems that the component is rushing to display results before the class has finished processing them, resulting in an error message being printed ...

Adding Node Modules during the setup of an ElectronJS application

Hey there! I'm currently working on an ElectronJS application designed for developers. One of the key features is checking for the presence of NodeJS on the user's computer. If it's not detected, the app will automatically download and insta ...

Looking to arrange an object by the value of a nested object in Typescript/Angular?

I'm currently developing an Angular 9 application focused on covid-19 cases, and I need to arrange my objects by the value of nested objects. Here is the dataset that I want to organize alphabetically based on the 'state' field values: stat ...

Is there a way to easily toggle a Material Checkbox in Angular with just one click?

Issue with Checkbox Functionality: In a Material Dialog Component, I have implemented several Material Checkboxes to serve as column filters for a table: <h1 mat-dialog-title>Filter</h1> <div mat-dialog-content> <ng-container *ng ...

Generating and assigning a unique filename based on a specific string - gulp

Looking for help as a complete beginner in Gulp. I'm trying to use a string from one file to name and create a new file. This way, I can identify the white label deployed on the server. One of the contents in the file with the string is: {"TITLE":"n ...

Unable to find solutions for all parameters in the Application Module: (?). Error occurred at syntaxError (compiler.js:1021) on the site stackoverflow.com

Upon reverting my Angular project from version 7 to 6 and integrating Angular Universal using @ngToolkit, a specific error message appeared in the browser console: The parameters for Application Module cannot be resolved: (?). at syntaxError (compiler.js: ...

Error message from BitBucket pipeline indicates that the npm command was not found

Upon deploying code to my server via the Bit Bucket scp pipeline, I encountered an issue with another pipeline meant to install node modules and start the node server. The pipeline returned a failed status and displayed the following error: ./server-run.s ...

Following the build process, ReactJS third party APIs are experiencing disruptions when accessed locally

My ReactJS application consists of client-side code and integration with third-party APIs. The app functions smoothly when running locally alongside the third-party APIs using npm start After building the app with npm run build I serve the build on m ...

Understanding how to handle prop types in a React application using Typescript

My current task involves using the react-google-maps library to integrate Google Maps API into my project. The documentation specifies a certain way to set up the maps component: const GoogleMapComponent: React.ComponentClass<{}> = compose( with ...

Leveraging import and export functionality in TypeScript while utilizing RequireJS as a dependency

I am in the process of transitioning a complex JavaScript application from Backbone/Marionette to TypeScript. While making this shift, I want to explore the benefits of exporting and importing classes using files as modules. Is it necessary to incorporat ...

Install a package from npm using yarn, not from the workspace

Having an issue with yarn workspaces in my current project: Within my monorepo, I have: a "packages" folder with npm packages an "apps" folder with node.js apps Specifically in one of my apps, I'm attempting to install a package from the "packages" ...

Personal npm script defined in ecosystem.config.js

When initiating a custom npm script start with pm2 as a one-time process, the command would be pm2 start npm -- start. To incorporate this into the ecosystem.config.js file, the app should be configured as ... script: 'npm', args: 'start&apo ...

How can global resolutions be defined in Yarn 1?

Recently, I've been utilizing Node 10 for my automation pipelines. However, when trying to execute yarn global add lerna, a new transitive dependency called @npmcli/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b0d6c3f081 ...

Categories for the Promise.all() function

I'm feeling lost trying to understand the differences between the request tuple return type and Promise.all(). This is driving me crazy. Any suggestions? const createPromises = async (utteranceObject: Array<string[]>): Promise<Array<[s ...

Get npm globally installed directly from a nearby folder complete with all necessary dependencies

After installing the public tool (csso-cli) using npm install -g csso-cli to make it globally available, I realized that I needed to update one of its dependencies (csso) to a newer version in order to utilize the latest features. In an attempt to do so, I ...

Is there a way to recursively convert property types from one to another in an object that contains optional properties?

The scenario: I am currently working with MongoDB and a REST API that communicates using JSON. MongoDB uses objects instead of identifiers for documents, but when these objects are stringified (such as in a response body), they get converted into strings. ...

"Linking a Next.js application with Azure's Application Insights for advanced insights

Trying to include my Next.js (TypeScript) app logs in Azure Application Insights has been a bit challenging. The documentation provided poor guidance, so I decided to follow this solution: https://medium.com/@nirbhayluthra/integrating-azure-application-ins ...

I am facing an issue with the asynchronous function as it is displaying an error message

**I am facing an issue with displaying categories. I have attempted to do this using async function, however the data is not showing up** <div class="form-group"> <label for="category">Category</label> <select id="categor ...