react-web icon indicating copy to clipboard operation
react-web copied to clipboard

运行react-web start时报错: ERROR in Path must be a string.

Open robinkam opened this issue 8 years ago • 9 comments

如题,按照文档安装了CLI,并初始化项目之后,运行react-web start时报错: ERROR in Path must be a string. Received undefined webpack: Failed to compile.

有没有谁遇到过这个问题啊?怎么解决呢?

robinkam avatar Feb 20 '17 04:02 robinkam

你应该进入项目后,再运行 react-web start

cssivision avatar Feb 20 '17 06:02 cssivision

我也遇到了相同的问题,请问是怎么解决的?

iQoderi avatar Feb 23 '17 07:02 iQoderi

把操作的具体步骤描述下

cssivision avatar Feb 23 '17 07:02 cssivision

把 NodeJS 版本 切换为 5.x

kunkun12 avatar Feb 23 '17 13:02 kunkun12

webpack config中outPut添加一个'publicPath': output: { publicPath: '..', ... }

isaacyan17 avatar Feb 27 '17 15:02 isaacyan17

@cherishyan 按照你所说的配置了webpack,不再报ERROR in Path must be a string. Received undefined的错误编译也通过了,但是打开网页的时候"Cannot Get /",项目是本身是空的react-native初始页面,配置大致是:[email protected]、react-native@^0.38.1、react-dom@^15.3.2、[email protected],有人在类似的版本配置中可以正常运行吗?

kimjuny avatar Mar 10 '17 02:03 kimjuny

@ronankim

add a key 'publicPath' to the webpack config output node

output:{ publicPath:'' }

sylcrq avatar Mar 22 '17 08:03 sylcrq

把node版本降低到5.X就解决了

ez-tech-global avatar May 07 '17 10:05 ez-tech-global

@cherishyan 按照你所说的配置了webpack,不再报ERROR in Path must be a string. Received undefined的错误编译也通过了,但是打开网页的时候"Cannot Get /",项目是本身是空的react-native初始页面,配置大致是:[email protected]、react-native@^0.38.1、react-dom@^15.3.2、[email protected],有人在类似的版本配置中可以正常运行吗?

publicPath的值别用 '..', 用空串 ''就行, "Cannot Get /"这是启动的web服务索引打包的路径不对

jeoy avatar Oct 16 '17 09:10 jeoy