0

I'm following the tutorial on ReactJsProgram.com and I'm attempting to install eslint using npm but I'm running into trouble. Here is the error message I'm getting: (node:77867) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version..

Here's the output from my console, along with my local machine's configuration:

~/Projects/React.js/duckr $ ls
actions.js          firebase-schema.js  package.json        redux-schema.js
app/                node_modules/       reducers.js         webpack.config.js
~/Projects/React.js/duckr $ npm install --save-dev eslint eslint-{config-standard,plugin-standard,plugin-promise}
(node:77867) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
npm WARN duckr@1.0.0 No description
npm WARN duckr@1.0.0 No repository field.
~/Projects/React.js/duckr $ node -v
v6.3.1
~/Projects/React.js/duckr $ npm -v
3.7.1
~/Projects/React.js/duckr $ npm list graceful-fs
duckr@1.0.0 /Users/mas/Projects/React.js/duckr
└─┬ webpack@1.13.1
  ├─┬ enhanced-resolve@0.9.1
  │ └── graceful-fs@4.1.5 
  └─┬ watchpack@0.2.9
    └─┬ chokidar@1.6.0
      └─┬ fsevents@1.0.14
        └─┬ node-pre-gyp@0.6.29
          └─┬ tar@2.2.1
            └─┬ fstream@1.0.10
              └── graceful-fs@4.1.4 

And here's what my package.json contains:

{
  "name": "duckr",
  "version": "1.0.0",
  "description": "",
  "main": "actions.js",
  "scripts": {
    "start": "webpack-dev-server",
    "production": "webpack -p"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "react": "^15.3.0",
    "react-dom": "^15.3.0",
    "react-router": "^2.6.1"
  },
  "devDependencies": {
    "babel-core": "^6.13.2",
    "babel-loader": "^6.2.4",
    "babel-preset-es2015": "^6.13.2",
    "babel-preset-react": "^6.11.1",
    "babel-preset-stage-0": "^6.5.0",
    "css-loader": "^0.23.1",
    "eslint": "^3.2.2",
    "eslint-config-standard": "^5.3.5",
    "eslint-plugin-promise": "^2.0.1",
    "eslint-plugin-standard": "^2.0.0",
    "html-webpack-plugin": "^2.22.0",
    "style-loader": "^0.13.1",
    "webpack": "^1.13.1",
    "webpack-dev-server": "^1.14.1"
  }
}

In case it's useful, I'm including my webpack.config.js file:

var HtmlWebpackPlugin = require('html-webpack-plugin')
var HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
  template: __dirname + '/app/index.html',
  filename: 'index.html',
  inject: 'body'
})

module.exports = {
  entry: [
    './app/index.js'
  ],
  output: {
    path: __dirname + '/dist',
    filename: "index_bundle.js"
  },
  module: {
    loaders: [
      {test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"},
      {test: /\.css$/, loader: 'style-loader!css-loader'}
    ]
  },
  plugins: [HTMLWebpackPluginConfig]
}

As well as my .babelrc file:

{
  presets: [
    'react',
    'es2015',
    'stage-0'
  ]
}

Any idea what I need to do to be able to install eslint into this project? Thanks!

Edit: there is a similar question to mine but the answer marked correct states I should run sudo npm update -g npm to fix the issue. However, when I attempt that I'm presented with the same error message, which is why I created this question.

Community
  • 1
  • 1
Abundnce10
  • 2,150
  • 3
  • 26
  • 41
  • Check this http://stackoverflow.com/a/37466305/3284355 – Molda Aug 10 '16 at 19:17
  • 1
    Possible duplicate of [How to fix 'fs: re-evaluating native module sources is not supported' - graceful-fs](http://stackoverflow.com/questions/37346512/how-to-fix-fs-re-evaluating-native-module-sources-is-not-supported-graceful) – ivarni Aug 10 '16 at 19:29
  • I saw that question. However, when I try to run `sudo npm update -g npm` (the answer marked correct) I'm presented with the same error message as when I try to `npm install eslint`: `(node:77867) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.` – Abundnce10 Aug 10 '16 at 19:59
  • I installed `nvm` and downgraded to `node v5.12.0` and then I was able to successfully install `eslint`. – Abundnce10 Aug 10 '16 at 22:00

2 Answers2

0

Just upgrade the version

sudo npm update -g npm

and check if version is chaining or not by

npm info graceful-fs -v

In my case it changed and worked

Lav Vishwakarma
  • 1,380
  • 14
  • 22
  • When I attempt to run `sudo npm update -g npm` I get the same error: `(node:77867) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.` – Abundnce10 Aug 10 '16 at 19:57
  • `npm -v` returns `3.7.1`. `npm info graceful-fs -v` returns `3.7.1` as well. – Abundnce10 Aug 10 '16 at 19:57
0

Moving from node v6.3.1 to node v5.12.0 allowed me to successfully install the eslint package.

Abundnce10
  • 2,150
  • 3
  • 26
  • 41