gpt4 book ai didi

node.js - 配置.output.path : The provided value "./" is not an absolute path

转载 作者:搜寻专家 更新时间:2023-11-01 00:11:01 24 4
gpt4 key购买 nike

我有一个错误:无效的配置对象。 Webpack 已使用与 API 架构不匹配的配置对象进行初始化。 - configuration.output.path: 提供的值“./”不是绝对路径!

在安装 reactjs 时我的 package.json 文件在下面

{
"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! reactset@1.0.0 start: `webpack-dev-server --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactset@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

请帮助解决方案:帮助安装的网址:

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

最佳答案

请更改

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

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

或者换句话说,改变 path: __dirname + '/'

关于node.js - 配置.output.path : The provided value "./" is not an absolute path,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44880344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com