Sijan Bhandari
Sijan Bhandari

Reputation: 3071

Issues with NPM : npm ERR! Failed to parse json npm ERR! No data, empty input at 1:1

I am trying to run a project on my local.I have installed npm and nodejs in my computer and try to set the project. The issues arose when I run npm install for the first time. The error message is:

npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "/usr/bin/nodejs" "/home/aaa/bin/npm" "install"
npm ERR! node v4.4.5
npm ERR! npm  v2.15.5
npm ERR! file /home/aaa/.npm/asynckit/0.4.0/package/package.json
npm ERR! code EJSONPARSE

npm ERR! Failed to parse json
npm ERR! No data, empty input at 1:1
npm ERR! 
npm ERR! ^
npm ERR! File: /home/aaa/.npm/asynckit/0.4.0/package/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR! 
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse

And my package.json file is :

```

{
  "name": "babel-with-gulp",
  "version": "1.0.0",
  "description": "Starter code for using Babel with Gulp",
  "main": "index.js",
  "scripts": {
    "test": "jest",
    "start": "gulp watch"
  },
  "author": "Carlos Souza <[email protected]> (http://csouza.me/)",
  "license": "ISC",
  "repository": {
    "type": "git",
    "url": "git+ssh://[email protected]/codeschool/babel-with-gulp.git"
  },
  "keywords": [
    "babel",
    "gulp",
    "es2015"
  ],
  "bugs": {
    "url": "https://github.com/codeschool/babel-with-gulp/issues"
  },
  "homepage": "https://github.com/codeschool/babel-with-gulp#readme",
  "devDependencies": {
    "babel-core": "^6.7.6",
    "babel-jest": "^15.0.0",
    "babel-polyfill": "^6.13.0",
    "babel-preset-es2015": "^6.14.0",
    "babel-preset-react": "^6.11.1",
    "babel-preset-stage-1": "^6.13.0",
    "babel-register": "^6.7.2",
    "babelify": "^7.2.0",
    "browser-sync": "^2.11.2",
    "browserify": "^12.0.1",
    "eslint": "^2.7.0",
    "eslint-plugin-react": "^4.2.3",
    "exorcist": "^0.4.0",
    "gulp": "^3.9.0",
    "gulp-eslint": "^2.0.0",
    "gulp-if-else": "^1.0.3",
    "gulp-imagemin": "^3.0.3",
    "gulp-uglify": "^1.5.3",
    "jest": "^15.1.1",
    "jquery": "^2.2.2",
    "react": "^15.0.1",
    "react-dom": "^15.0.1",
    "react-router": "^2.7.0",
    "react-test-renderer": "^15.3.1",
    "vinyl-buffer": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.7.0"
  },
  "dependencies": {
    "immutable": "^3.8.1",
    "material-ui": "^0.15.4",
    "react-addons-css-transition-group": "^15.3.1",
    "react-bootstrap": "^0.30.3",
    "react-player": "^0.9.0",
    "react-redux": "^4.4.5",
    "react-tap-event-plugin": "^1.0.0",
    "redux": "^3.6.0"
  }
}

``` Did I missed any prerequisite to run the code? or is there any compatibility issue? I have node (4.4.5) version and npm (2.15.5).

Upvotes: 2

Views: 1127

Answers (1)

Mahdi Akbary
Mahdi Akbary

Reputation: 107

Clean the cache first with npm cache clean and then you can run the command without any errors.

Upvotes: 1

Related Questions