Having trouble with hanging and failing npm installation on Windows 10?

I keep encountering issues with my npm installations on Windows 10, even though I have the latest stable versions of node.js and npm. Every time I try to run 'npm install' in my project folder, which was initially set up with express following this guide, it fails. Below is an excerpt from the error log showing a file directory error regarding 'amdefine'. I'm at a loss here - can anyone offer some assistance?

1315 verbose stack Error: ENOENT: no such file or directory, rename 'C:\Users\carte\Desktop\Queue\Queue\node_modules\amdefine' -> 'C:\Users\carte\Desktop\Queue\Queue\node_modules.amdefine.DELETE' 1316 verbose cwd C:\Users\carte\Desktop\Queue\Queue 1317 verbose Windows_NT 10.0.16299 1318 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\carte\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "--verbose" 1319 verbose node v8.11.0 1320 verbose npm v5.8.0 1321 error path C:\Users\carte\Desktop\Queue\Queue\node_modules\amdefine 1322 error code ENOENT 1323 error errno -4058 1324 error syscall rename 1325 error enoent ENOENT: no such file or directory, rename 'C:\Users\carte\Desktop\Queue\Queue\node_modules\amdefine' -> 'C:\Users\carte\Desktop\Queue\Queue\node_modules.amdefine.DELETE' 1326 error enoent This is related to npm not being able to find a file. 1327 verbose exit [ -4058, true ]

Answer №1

While this may be considered an older issue, I recently encountered the same problem and struggled to find a solution. So, I wanted to share my fix in case it can help someone else.

The root of my problem stemmed from having npm installed on C:\, while my project (or git folder) was located in G:\. Relocating my folder from G:\ to C:\Desktop and then running npm install resolved the issue for me.

I'm not entirely certain if the resolution was due to moving it to C:\ or because it was moved outside of the git-folder structure.

Additionally, prior to making those changes, I cleared the npm cache using the --force flag.
For reference, I am using npm v6.7.0 and node v10.15.1

Answer №2

What is your current npm version? These errors typically occur with npm versions below 5.5. For CLI troubleshooting.

Additional Information:
npm -v shows: 5.6.0
node -v shows: 8.9.1
npm config get registry shows: https://registry.npmjs.org/
Operating System: Windows 10

Answer №3

My npm install process got stuck due to TypeScript continuously monitoring files within the directory. The fix involves halting any tools that are actively watching files and then attempting the installation again.

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

Express throwing module errors

I encountered an issue while attempting to expose a REST service in an electron app using expressJS. Following a tutorial, I added express and @types/express to the project. However, when trying to implement a "get" method and running the build with ng bui ...

Encountering errors while attempting to share files in a system built with Node.js, Express,

This snippet shows my Node.js code for connecting to a database using Mongoose const mongoose = require('mongoose'); function connectDB() { // Establishing Database connection mongoose.connect(process see your Naughty's you're sure ...

Why not include a designated package version in the package.json file? This way, we can eliminate the need for the package-lock.json file

As a newcomer to NPM, please bear with me if my questions seem basic. Here's what I'm curious about: Q1- For instance, when I install a package and explicitly mention the version like this: npm install [email protected] why does it cha ...

Looking for a particular root node in a tree structure?

I am currently working on converting docx files to xml and using DOM to locate the parent node of a specific element. For instance <chapter> <title> <label>Chapter 1 </label> </title> ...

Here's a unique version: "Sharing data between functions in the Express GET API within MEAN Stack"

Within my code, I have a function called hsResponse which operates as described below. When I run this function independently, I am able to see the expected body response in the console log. Now, I would like to incorporate this hsResponse function within ...

Leveraging Handlebars for templating in Node.js to incorporate a customized layout

app.js const exphbs = require('express-handlebars'); app.engine('handlebars', exphbs({defaultLayout: 'layout'})); app.set('view engine', 'handlebars'); app.use('/catalog', require('./routes/ ...

Is it possible to verify the expiration status of a JWT token in Node.js using Express.js?

Is there a way to verify if my token has expired? const token = jwt.sign(user,app.get('superSecret'),{ expiresIn : 2 }); ...

Need assistance designing a web interface for managing StrongLoop build and deployment tasks?

I am interested in developing a web user interface for StrongLoop. This UI would allow users to easily build and deploy processes similar to StrongLoop Arc. There are some simple node applications (Web Services) that have not been created using StrongLoop ...

Searching for raw queries in Sequelize using Node.js

For a while now, I've been attempting to execute a raw query using sequelize. After following some online guides, this is the code that I have come up with: var sequelize = new Sequelize('name', 'user', 'password'); va ...

Unexpected errors are encountered when using ng serve

When I run the ng serve command, unexpected errors are occurring on my system. The errors include: PS C:\Users\SAYED-SADAT\Desktop\data\coding\itsm-frontend\itsm-frontend> ng serveYour global Angular CLI version (13.0 ...

The concept of overloading operators in V8

Here's a question that I've been pondering, but couldn't seem to find any answers for on Google. While it may not be achievable in pure JavaScript, let's say I'm developing a container class in V8 and then returning that class bac ...

What regular expression should be used to meet the following requirement in JavaScript?

Criteria: Find words that begin with 'a' and end with 'b', with a digit in the middle, but are not on lines starting with '#' Given string: a1b a2b a3b #a4b a5b a6b a7b a8b a9b Expected output: a1b a2b a3b a7b a8b ...

Does node.js perform well for non-server functions like command line scripts?

My understanding is that node is a high-speed, non-blocking I/O platform that can be used for more than just network applications. Are there any scenarios where using node, outside of being a server, would prove advantageous? For instance, for developing ...

How can I change a PDF file into a doc or docx format using an npm/node package or through coding?

I've been searching for a solution to convert PDF files to doc/docx format using Node JS, but so far I haven't found any node module or code that can do the job. Is there a workaround or alternative method that I can try? ...

Leverage elements from nearby npm repository when building an Angular 2 application

After developing a generic chart component using d3 and Angular 2, I decided to share it by publishing it in a local npm repository. This way, anyone can easily incorporate the chart component into their Angular project by simply running the npm install my ...

How can I send two responses in a single POST request using node.js?

Below is my router setup for handling responses: questionRouter.post('/questionsReply', (req, res) => { twilioResp(req, res); var newResponse = new Response(req.body); newResponse.save((err, data) => { if (err) return handleDBError(er ...

The only thing you can see in MongoDB output is the objectid

Trying to save data in mongodb using an open schema. After making a post request, the only thing showing up in the database is the objectid. As someone new to MongoDB and Node.js, I'm struggling to identify where my mistake lies. // <---------se ...

Troubleshooting the error code 89 from the Twitter API

Recently, when running my app, an error message popped up that read: "[ { code: 89, message: 'Invalid or expired token.' } ]". I'm puzzled as to why this is happening. About a week ago, everything was functioning smoothly. Even after genera ...

Guide on establishing connections with multiple socket clients in nodejs

Imagine this scenario: I have a server where socket(1) runs, and another server where socket(2) client connects to socket(1). Additionally, I have one browser socket that connects to socket(1). The goal is to send requests from the browser and retrieve d ...

Top method for transitioning project from Vue2 to Vue3

I am looking to take my project to the next level with vue3 This project is based on symfony and utilizes vue as separate components on the frontend Since I have never tackled a major upgrade before, I'm unsure of the best approach. Any suggestions? ...