I’m trying to install Grunt on my project. It used to work perfectly, but now for some reason, it does not. Every time i try to install Grunt, I got this error:
JavaScript
x
11
11
1
npm ERR! path C:irreleventpathprojectnode_modulesansi-styles
2
npm ERR! code ENOENT
3
npm ERR! errno -4058
4
npm ERR! syscall rename
5
npm ERR! enoent ENOENT: no such file or directory, rename 'C:irreleventpathprojectnode_modulesansi-styles' -> 'C:irreleventpathproject.ansi-styles.DELETE'
6
npm ERR! enoent This is related to npm not being able to find a file.
7
npm ERR! enoent
8
9
npm ERR! A complete log of this run can be found in:
10
npm ERR! C:UsersMeAppDataRoamingnpm-cache_logs2018-04-03T00_52_10_105Z-debug.log
11
The weird thing is that the missing package change every time.
I try verifying the cache, removing the node_modules
folder, cleaning the cache using --force
. Uninstall NPM and NodeJS, restart my computer. No chances.
I had to format my computer for security reason, I took the project folder but not the Roaming
folder, I don’t know if this had an impact, but it shouldn’t since I reinstalled NPM.
I’m not sure if this will help but here is my package.json
JavaScript
1
23
23
1
{
2
"name": "project",
3
"version": "2.1.0",
4
"repository": "project-2.0",
5
"devDependencies": {
6
"grunt": "^1.0.2",
7
"grunt-cli": "^1.2.0",
8
"grunt-contrib-concat": "~1.0.1",
9
"grunt-contrib-copy": "^1.0.0",
10
"grunt-contrib-cssmin": "~2.0.0",
11
"grunt-contrib-jshint": "~1.1.0",
12
"grunt-contrib-uglify": "~2.2.0",
13
"grunt-contrib-watch": "~1.0.0",
14
"grunt-html-build": "^0.7.1",
15
"grunt-real-favicon": "^0.2.2"
16
},
17
"dependencies": {
18
"angular-bootstrap-colorpicker": "^3.0.31",
19
"angularjs-geolocation": "^0.1.3",
20
"sprintf-js": "^1.1.1"
21
}
22
}
23
Advertisement
Answer
Try these steps:
- Delete
package-lock.json
and run NPM again. - Ensure no other processes of node.js are running (check task manager)
- If you are using visual studio code, close it and try running
npm install
again. - If all else fails, restart your computer.
See thread here: https://github.com/npm/npm/issues/17444