Npm setup error code 128

When trying to run npm install after next install of Node and Git

I get the following error:

enter image description here

Does anyone know what could be causing this, and what to do to fix it?

package.json (company information removed)

 { "name": "xxx", "version": "1.0.0", "description": "xxx", "engines": { "node": "5.0.0", "npm": "3.3.9" }, "repository": "xxx", "private": true, "license": "UNLICENSED", "dependencies": { "dijit": "https://github.com/dojo/dijit.git#1.10.4", "dojo": "1.10.4", "fg-dialog": "0.1.5", "politespace": "0.1.4", "shoestring": "1.0.3" }, "devDependencies": { "body-parser": "^1.14.1", "chalk": "^1.1.1", "compression": "^1.6.0", "del": "^2.0.2", "dojo-util": "https://github.com/dojo/util.git#1.10.4", "express": "^4.13.3", "glob": "^5.0.15", "gulp": "^3.9.0", "gulp-concat": "^2.6.0", "gulp-git": "^1.6.0", "gulp-html-minifier": "^0.1.6", "gulp-jsbeautifier": "^1.0.1", "gulp-jshint": "^1.11.2", "gulp-jshint-xml-file-reporter": "^0.5.1", "gulp-jsonminify": "^1.0.0", "gulp-replace": "^0.5.4", "gulp-task-listing": "^1.0.1", "gulp-uglify": "^1.4.1", "gulp-util": "^3.0.6", "gulp-zip": "^3.0.2", "intern": "https://github.com/theintern/intern.git", "jshint-stylish": "^2.0.1", "merge-stream": "^1.0.0", "minimist": "^1.2.0", "open": "^0.0.5", "q": "^1.4.1", "request": "^2.65.0", "require-dir": "^0.3.0", "run-sequence": "^1.1.2", "selenium-standalone": "^4.6.3" }, "scripts": { "postinstall": "gulp install" } } 
+5
source share
6 answers

The recommended first step is to use the latest version of npm:

 npm install -g npm 

(You may need sudo ). You are using npm 2.x, the latter is 3.5.x.

+8
source

First, I deleted the npm and npm-cache directories that are in c:\myUser\AppData\Roaming . Then I read npm install -g npm . This solved my problem.

+2
source

Error in the revision, in particular, the use of 1.10.4. Make sure the BitBucket repositories for dijit.git and util.git are configured with tags. Additional information on versioning / tags in Atlassian: https://confluence.atlassian.com/bitbucket/use-repo-tags-321860179.html .

If you use SSH with a password saved, links to your personal repositories will need to be connected via SSH using the following format.

 git+ssh:// git@bitbucket.org /{user}/{repository}.git 
+2
source

I had the same npm 128 error code, but it also had a link to the debug.log file in the npm cache, which revealed the real problem.

Two of the dependencies in package.json pointed to private repositories directly, which I do not have access to.

Once I fixed ( details here ), I was able to successfully run npm install. Note: npm reinstallation or upgrade is not required!

+2
source

In my case, I just updated npm, and package-lock.json tried to install one of the project packages from an inaccessible version of git commit.

Removing and allowing npm to recreate the package-lock.json file resolved the issue.

 rm package-lock.json 

Note. . It seems that package-lock.json supports more detailed information about the node_modules tree, so in a complex / specific project it may be important to highlight specific lines (lines) causing the problem, and just delete the package-lock.json file.

https://docs.npmjs.com/files/package-lock.json

+2
source

you should use cmd as adminstrator on windows or add sudo on linux

+1
source

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


All Articles