Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while running npm install

Tags:

git

npm

When running npm install I get the following error:

npm ERR! code 1
npm ERR! Command failed: /usr/bin/git checkout ~3.9.0
npm ERR! error: pathspec '~3.9.0' did not match any file(s) known to git.
npm ERR!

node and npm versions:

$ node -v
v10.4.0

$ npm -v
6.1.0

I tried downgrading npm and also running it on two different machines but got the same results.

Here are the dependencies in package.json:

"dependencies": {
"@bower_components/jquery": "jquery/jquery-dist#3.3.1",
"@bower_components/lodash": "lodash/lodash#~3.9.0",
"autosize": "^4.0.2",
"babel-core": "^6.26.3",
"babel-jest": "^23.0.1",
"babel-loader": "^7.1.4",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-rewire": "^1.0.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"chai": "^4.1.2",
"chart.js": "^2.7.2",
"chartkick": "^2.3.5",
"chosen-js": "^1.8.5",
"core-js": "^2.5.7",
"create-react-class": "^15.6.3",
"del": "^3.0.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-15": "^1.0.2",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.8.2",
"event-stream": "^3.3.4",
"gulp": "^3.8.7",
"gulp-autoprefixer": "^4.0.0",
"gulp-cached": "^1.1.1",
"gulp-clean": "^0.3.0",
},
 "scripts": {
"test": "jest",
"start": "gulp dev",
"hot": "gulp hot-dev",
"build": "gulp build"
}
like image 424
Mei Avatar asked Jun 13 '18 00:06

Mei


Video Answer


1 Answers

Same problem for me for 4.0 I have one dependency in package.json "gulp": "github:gulpjs/gulp#4.0",

I removed #4.0 and its working now.

like image 152
sushama Avatar answered Sep 21 '22 04:09

sushama