Error installing npm. errno 4058

when I try to install the dependencies for my package, I get the following error

npm WARN package@1.0.0 No description
npm WARN package@1.0.0 No repository field.

npm ERR! path C:\Users\user_name\Desktop\typeScript_react_webpack_app_template\node_modules\typescript
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\user_name\Desktop\typeScript_react_webpack_app_template\node_modules\typescript' -> 'C:\Users\user_name\Desktop\typeScript_react_webpack_app_template\node_modules\.typescript.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user_name\AppData\Roaming\npm-cache\_logs\2017-07-07T08_55_48_803Z-debug.log

my package.json

{
  "name": "package",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel-core": "^6.25.0",
    "babel-loader": "^7.1.1",
    "babel-preset-es2017": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "ts-loader": "^2.2.2",
    "typescript": "^2.4.1",
    "webpack": "^3.0.0"
  },
  "dependencies": {
    "react": "^15.6.1",
    "react-dom": "^15.6.1"
  }
}

if I install the package as npm install typescript, everything works fine. What could be the solution to this problem?

+4
source share
1 answer

remove package-lock.json and run npm again

Check if node and npm are installed correctly

for type checking

npm -v

if the number has not arrived, set it correctly.

If any cam number then npm is set and then go ahead

Quick fix: -delete package-lock.json and try again

If the above does not work, then follow the steps below.

1) remove package-lock.json

2) nodejs

3) npm init npm install

4) ,

0

Source: https://habr.com/ru/post/1680946/


All Articles