Madhur
Madhur

Reputation: 1772

configuration.output.path: The provided value "./" is not an absolute path

I have got an error : Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration.output.path: The provided value "./" is not an absolute path!

while installing reactjs My package.json file down below

{
  "name": "reactset",
  "version": "1.0.0",
  "description": "react",
  "main": "index.js",
  "scripts": {
    "start": "webpack-dev-server --hot"
  },
  "keywords": [
    "test"
  ],
  "author": "test",
  "license": "ISC",
  "dependencies": {
    "babel-core": "^6.25.0",
    "babel-loader": "^7.1.1",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "react": "^15.6.1",
    "react-dom": "^15.6.1",
    "webpack": "^3.0.0",
    "webpack-dev-server": "^2.5.0"
  }
}
using upgraded node version 4.0 and npm 5.0 
Error : 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `webpack-dev-server --hot`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Please help for solving solution : Url which help for installing :

https://www.tutorialspoint.com/reactjs/reactjs_environment_setup.htm

Upvotes: 3

Views: 4500

Answers (2)

Sam Houston
Sam Houston

Reputation: 3651

If you're using ES modules, use this:

output: {
  path: process.cwd(),
  filename: 'index.js',
}

or

output: {
  path: path.join(process.cwd(), 'dist'),
  filename: 'index.js',
}

Upvotes: 0

Lokinder Singh Chauhan
Lokinder Singh Chauhan

Reputation: 2686

Please Change

 output: {
      path:'./',
      filename: 'index.js',
   }

To

 output: {
      path: __dirname+'/',
      filename: 'index.js',
   }

Or in other words change path: __dirname + '/'

Upvotes: 13

Related Questions