Netlify is unable to install a forked npm module due to the failure to retrieve metadata

I recently forked and modified the g-sheets-api module. Here is my version: https://github.com/lpares12/g-sheets-api

After making the modifications, I installed it in my web project using the following command:

npm install git+https://github.com/lpares12/g-sheets-api.git --save-dev

However, upon uploading the project to Netlify, it fails with errors like:

8:30:02 PM: Installing npm packages using npm version 8.19.3
8:30:02 PM: npm WARN old lockfile
8:30:02 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
...

Furthermore, I am encountering several other errors such as:

8:30:19 PM: npm WARN old lockfile     'sh: 1: tsc: not found\n' +
8:30:19 PM: npm WARN old lockfile     'npm ERR! code 127\n' +
...

This issue is puzzling, especially since running npm run dev or npm run build within the project works correctly. When inspecting the package-lock.json of the deployed app, I can see the following:

    "g-sheets-api": { 
      "version": "git+https://github.com/lpares12/g-sheets-api.git#4e8ec12a4654d29421b131ddfe4bcff540589cc8", 
      "from": "git+https://github.com/lpares12/g-sheets-api.git", 
      "dev": true, 
      "requires": { 
        "cross-fetch": "^3.1.5" 
      } 
    }

It appears that the commit exists and is public, yet the deployment issue persists. Any assistance on this matter would be greatly appreciated.

For context, I am utilizing Netlify, Vite, and Typescript in this project.

Answer №1

The problem arises from the module g-sheets-api that needs tsc but lacks declaring it as a dependency (or devdependency) in the package.json.

As it is not automatically installed through npm, it results in a failure to execute.

The best solution is to include it in the package.json.

Alternatively, using npx tsc is possible, but it complicates the package management process and may not function on isolated build systems.

Answer №2

Solved the issue by executing these commands within the updated module:

npm install typescript --save-dev
npx tsc

Afterwards, uploaded the build directory to github.

I'm still puzzled about why this solution resolved the problem, so I'll keep this thread active in case anyone can provide further insight.

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

Encountered an issue while trying to use Figma's spellchecker extension

Despite following the instructions in the readme carefully, I am facing difficulties running the Figma spellchecker extension. Executing npm run build goes smoothly. But when I try to run npm run spellcheck, I encounter an error message in the console: co ...

Karma: Unable to Proceed due to Lack of Permissions while creating tests on Travis CI

My unit tests are running successfully on my local machine when I execute the test script using npm. Below is my test script: "test": "karma start test/unit/karma.config.js --single-run" This is my Karma Configuration: var webpackConfig = require(&apos ...

Can an object's keys be strongly typed according to array values?

To utilize normalized data effectively, I have created an object with keys that can only be a list of numbers within a specified array. Is there a way to enforce this restriction in typing so that if I attempt to access the object using a non-array key, an ...

Trouble with maps not showing up and the console isn't showing any errors when using @react-google-m

Currently, I am facing an issue while trying to integrate Google Maps by following a blog post that provides instructions on next13 TypeScript. Despite reaching the point where the maps should be displayed, nothing appears on the screen. Surprisingly, ther ...

What is the method for implementing an Inset FAB with Material UI in a React project?

Currently, I am working on a project that requires an "Inset Fab" button to be placed between containers. After referencing the Material Design documentation, I discovered that the component is officially named "Inset FAB". While I was able to find some tu ...

Exploring TypeScript: A Study on Interfaces and Abstraction

I am working with TypeScript and have created four different entities (models) as shown below: Base model definition: export interface BaseModel { id: string; entityId: string; entityName: string; } Child Model 1: import { BaseModel } from ' ...

The ng build process remains active and does not exit while staying in the terminal

Since upgrading to Angular 15, I have encountered an issue with my build process. "build:project:prod": "ng build project --configuration prod --stats-json=true --single-bundle=true && npm run copyAssets" After the build comple ...

Unable to run any npm scripts in a React project

My React application has been running smoothly for a while, but recently all the npm commands in the package.JSON file have stopped working. { "name": "fitness-appication-frontend", "version": "0.1.0", "private": true, "dependencies": { "reac ...

Definition of Angular 2 File

I have developed a custom Gantt chart library using D3 in vanilla JavaScript. Now, I am trying to integrate it into my Angular 2 application. After installing D3 via npm and adding the necessary type files and the Gantt chart module to node_modules, I enco ...

The method getManyAndCount() in TypeORM does not include related data in its return result

I'm completely new to TypeORM and NestJs. Currently, I am working on a project where I have an entity called VehicleModel which has a ManyToOne relationship with VehicleBrand. However, when I execute getManyAndCount() on my query, I am puzzled as to ...

What sets apart `npm install --save-dev gulp-uglify` from `npm install gulp-uglify`?

I'm feeling perplexed regarding the npm installation process. Based on what I've gathered, there are several options available to me when installing modules: The -g option which saves modules globally --save-dev No arguments. Could someone cl ...

There seems to be a lack of information appearing on the table

I decided to challenge myself by creating a simple test project to dive into Angular concepts such as CRUD functions, utilizing ngFor, and understanding HttpClient methods (specifically get and post). After creating a Firebase database with an API key and ...

A guide on resetting a Nodemon server using code

At the beginning of server start, I have an array of JSON objects that are updated. But if I make changes to the JSON data using NodeJS FS instead of manually editing it, Nodemon does not restart. Is there a way to programmatically restart nodemon? ...

What is the best way to access a private class variable within the sockent.on function in Angular?

export class AppComponent { title = 'my-app'; constructor(private notifyService : NotificationService) {} ngOnInit() { socket.on("laravel_database_chat:test", function(message){ //I AM ATTEMPTING TO INVOKE THE NOTIF ...

How can I save a TypeScript object to Firebase using serialization?

Having an issue: Within my angular application, I have implemented a lot of classes with inheritance. However, upon attempting to save these objects to Firebase, I encountered an error indicating that I am trying to persist custom objects which is not supp ...

Having trouble utilizing Vue3 methods while utilizing the `<script setup lang="ts">` syntax

Looking to incorporate Vue into a non-Vue Class using the Composition API for a Chrome Extension project where having the entire thing as a Vue App doesn't make sense. The Vue Instance is being instantiated in the usual manner and then injected into ...

I am having trouble getting the "npm run build" command to work properly on my React app project

After successfully initializing my react project, I encountered an issue when trying to build it. The error message I received is as follows: node:internal/fs/utils:344 throw err; ^ Error: UNKNOWN: unknown error, lstat 'C:\Users\dar ...

Error encountered: "When attempting to run the npm run build command for a React project, the code ELIFECY

Error: Parse Error: <title id=>Polygon NC</title> <link href="/static/css/main.522ad556.chunk.css" rel="stylesheet"></head> <body> <div id="root"></div> <script>!function(e){function r(r){for(var ...

Troubleshooting a TypeScript error when trying to access an imported service in Angular 2

I've been working on creating a form that allows users to input required details, which will trigger a server call and save the information. However, no matter what I try, I keep encountering the following error: ORIGINAL EXCEPTION: TypeError: this.po ...

The React hook useState is struggling to accurately map array objects

Recently, I encountered an issue with a form that sends an array of objects to another React Functional Component: import React, { useState } from 'react' import uuid from 'uuid/v1'; const NewMovieForm = ( {addMovie }) => ...