Ways to remove a

After creating an npm link within a local dependency and then deleting that dependency from my hard drive, I am now attempting to remove this npm link.

I have attempted the following steps:

  • npm rm --global dependency
  • npm uninstall dependency
  • npm unlink --no-save dependency

Despite going through these actions and removing the code from my hard drive, the npm link dependency command still works when executed in my main project. How can I properly delete it? Here is my package.json:

{
  "name": "myproject",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "webpack serve",
    "build": "webpack --mode production"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "copy-webpack-plugin": "^9.0.1",
    "d3-array": "^3.0.1",
    "d3-dsv": "^3.0.1",
    "d3-format": "^3.0.1",
    "d3-scale": "^4.0.0",
    "d3-time-format": "^4.0.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "typescript": "^4.3.5"
  },
  "devDependencies": {
    "@types/d3-array": "^3.0.1",
    "@types/d3-dsv": "^3.0.0",
    "@types/d3-format": "^3.0.1",
    "@types/d3-scale": "^4.0.1",
    "@types/d3-time-format": "^4.0.0",
    "@types/react-dom": "^17.0.9",
    "html-webpack-plugin": "^5.3.2",
    "ts-loader": "^9.2.3",
    "webpack": "^5.44.0",
    "webpack-cli": "^4.7.2",
    "webpack-dev-server": "^3.11.2"
  }
}

Answer №1

Could you please share your package.json file?

Oddly enough, this seems to be causing issues.

npm unlink dependency
rm -rf node_modules && npm install

This question was previously raised on How do I uninstall a package installed using npm link?

Update: You can also remove the symlink from the global node_modules directory.

Locate the global directory using npm list -g and delete the corresponding folder.

   rm -rf `npm list -g | head -1`/node_modules/dependency

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

Can Vuejs delay the calculation of a computed property until the component is "ready"?

Within my Vue.js application, I have a `computed` property that relies on a value fetched from an AJAX call. I am looking for a way to delay the calculation of this `computed` property until after the `ready` method has completed. While everything is fun ...

Receiving the error message "Encountered SyntaxError: Unexpected token )" when using a custom directive

Encountering an issue with the customer directive of auto-complete, as I am receiving the error Uncaught SyntaxError: Unexpected token ). This error is displayed in the console of the chrome browser as VM80623:1 Uncaught SyntaxError: Unexpected token ). Cl ...

Obtain image from an external server using AJAX

Our team is currently working on retrieving images from external servers that are cross-origin. While JSONP may not be effective in this case, we are exploring the use of plain AJAX GET requests. One potential workaround involves using iframes to manipulat ...

Enhancing functionality by integrating Jquery/JS with input fields and labels

I am currently facing a challenge in applying CSS to the label element when the corresponding input is selected. After attempting and failing to use input:checked + label due to limitations in the HTML structure that cannot be altered, I seek alternative ...

How can I efficiently locate identical sequences of cells in two or more arrays?

Unique Example 1 We can explore an interesting scenario by considering two arrays: ('m','o','o','n','s','t','a','r','d') ('s','t','a', ...

The Ajax form is failing to send any headers

Whenever I submit my form, the header data doesn't seem to be coming through. Even though I've done this type of submission numerous times (figuratively speaking), there's always a chance that I might be overlooking something. Any ideas? Che ...

Error in typescript: The property 'exact' is not found in the type 'IntrinsicAttributes & RouteProps'

While trying to set up private routing in Typescript, I encountered the following error. Can anyone provide assistance? Type '{ exact: true; render: (routerProps: RouterProps) => Element; }' is not compatible with type 'IntrinsicAttribu ...

Tips on updating Angular data model when a static HTML element changes

Currently, I am utilizing the editable-table jQuery plugin to enable editing in a table. This tool is simple to implement, lightweight, and highly efficient. The markup structure for this task looks like this: <tr ng-repeat="o in orders"> <td ...

What are the steps to retrieve marker data from a MySQL database and showcase them dynamically on a Google Map using AJAX? Addressing time constraints

Utilizing a combination of JavaScript, Google Maps API, PHP, and MySQL, my app is designed to extract a list of markers from a MySQL database, export them to a myXML.xml file, and then load these markers onto the map each time it loads. <!DOCTYPE html& ...

Can Comet be implemented without utilizing PrototypeJs?

Can Comet be implemented without utilizing PrototypeJs? ...

Missing folders in npm package

After successfully creating and publishing a private npm package, I noticed an inconsistency in the file structure when installing it on another project: Library.Util | |__index.js | |__package.json The original file structure of the package includes a t ...

Uploading photos to Postgres through express/multer

Currently, I am using Postman to send images to a POST route through the Express library. However, when I retrieve the buffer of binary data, I am unable to process it accordingly. Will using body-parser resolve this issue? This is how I am uploading the ...

What is the best way to fetch JSON data in React from the start and then manipulate it as needed before exporting to another file within my application?

I have a scenario where I need to fetch data from a MongoDB database using async/await fetch() and save it in a file called data.js. However, I am facing an issue with React executing "in parallel" due to the nature of async/await. This makes it difficult ...

Tips for managing nested objects within React state and keeping them updated

Could someone kindly point out where I might be going wrong with this code? Upon checking the console.log, it seems like the date function is functioning correctly. However, despite using this.setState, the timestamp remains unchanged. Any help would be gr ...

Update the objects with new values when the user makes changes in the

I am working with dynamically created input fields const [data, setData] = useState({ native: [{}], rolls: [{}] }) // initial data {navtive?.map((item, index) => { return ( <input type="text" name={item.id} ...

Change the function to utilize an HTML class rather than an ID

I am currently working on a resize image function that requires the ID of a file input element as an input. The function takes the image in the form and outputs a resized canvas of the image. However, I recently made changes to the form structure from a st ...

Utilizing prototype JS to create a dynamic floating widget or banner

I recently developed a custom script based on the original jQuery code found at this link: However, I encountered issues when attempting to implement it with prototype JS. Specifically, there seems to be accuracy problems with calculating the upper and lo ...

Executing a function immediately upon the start of a new month in JavaScript (Node.js) without relying on any external libraries?

Is it possible to automate the process of creating a document in MongoDB using Mongoose every 1st of a new month, ideally as soon as the date changes without relying on third-party libraries like needle or cronjob? Can this be achieved solely with setInter ...

ReactJS displays a collection of items stored within its state

I encountered an issue while trying to display a list of items in my React app with the following error message: Objects are not valid as a React child (found: [object MessageEvent]). If you meant to render a collection of children, use an array instead. ...

Changing a global variable via an AJAX call

I seem to be facing a common issue that many others have encountered. Despite my understanding that global variables can be modified inside functions in Javascript, I am struggling with this concept in practice. var lastMessage = 0; function loadChat() { ...