执行NPM操作持续出现ENOENT文件缺失错误,求解决方案
.dezalgo.DELETE in npm Hey there, I know how frustrating it is when npm keeps throwing errors even after you’ve reinstalled Node and npm—let’s work through this step by step to get it fixed.
First, let’s break down the issue: that .dezalgo.DELETE error almost always means a previous installation got interrupted, leaving behind corrupted or half-deleted files in your project’s node_modules folder. Here’s what you can do to resolve it:
Step 1: Clean up your project’s local dependency files
- Navigate to your project folder in the terminal first:
cd /Users/victor/Desktop/myprog - Delete the entire
node_modulesfolder and thepackage-lock.jsonfile—these are the most common sources of corrupted dependency issues:rm -rf node_modules package-lock.json
Step 2: Clear npm’s cached files
Corrupted cache can cause all kinds of weird, persistent errors. Force-clear the npm cache with this command:
npm cache clean --force
Step 3: Reinstall dependencies correctly
- First, reinstall your project’s base dependencies to get a fresh, clean set:
npm install - Now, install
vue-draggablewith the right syntax. Quick heads-up: the--saveflag doesn’t make sense with global installs (-g) because global packages aren’t linked to your project’spackage.json. Adjust your command based on what you need:- For a global installation:
npm install -g vue-draggable - For a project-specific installation (added to your
package.json):npm install --save vue-draggable
- For a global installation:
Step 4: Fix lingering global npm issues (if needed)
If you still run into problems after the above steps, try reinstalling the global npm package itself (even though you reinstalled Node, this can fix lingering global cache glitches):
npm install -g npm@5.6.0
(Sticking to your current npm version since you specified it, but you could also try upgrading to a newer version compatible with Node 8.9.1 if this doesn’t work.)
These steps should wipe out any corrupted files or cache causing the .dezalgo.DELETE error. Let me know if you hit any snags along the way!
内容的提问来源于stack exchange,提问作者Victori

