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

编译没过,新手求指导

Open xiang193 opened this issue 8 years ago • 15 comments

react-native init test react-web init test cd test

cd test && npm install 安装依赖包的时候,有些报了一些warning,提示包的依赖问题 用cnpm一个一个安装之后,执行npm install 没有warning了 但是在 执行 react-web start 报下面的错误 Error: Can't find webpack config file at "....node_modules/[email protected]@react-web/web/webpack.config.js"

xiang193 avatar Jun 04 '17 13:06 xiang193

webpack.config.js 这个文件在其实在这个路径下有 "....node_modules/[email protected]@react-web/webpack.config.js" demo里面这个文件的路径是"....node_modules/[email protected]@react-web/webpack.config.js"

尝试把"....node_modules/[email protected]@react-web/webpack.config.js" copy到"....node_modules/[email protected]@react-web/web/webpack.config.js" 但是会报别的错误

xiang193 avatar Jun 04 '17 13:06 xiang193

是不是我哪里配置有问题,或者哪里没改对 新建了项目之后就没有改过,都是init之后的

xiang193 avatar Jun 04 '17 13:06 xiang193

提示warning是说某些包因为版本不对没有install 我就把包按照提示的版本都安装了一下

xiang193 avatar Jun 04 '17 13:06 xiang193

编译过了,后面有问题再看吧 修改了一个路径 react-web/local-cli/defaultConfig.js

 //const WEBPACK_CONFIG = 'web/webpack.config.js';
 const WEBPACK_CONFIG = 'webpack.config.js';

xiang193 avatar Jun 04 '17 13:06 xiang193

3000端口是开了,貌似还是有问题,页面没响应 DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

xiang193 avatar Jun 04 '17 14:06 xiang193

node 7.6.0 升级中

xiang193 avatar Jun 04 '17 14:06 xiang193

升级之后,我就彻底放弃了

xiang193 avatar Jun 04 '17 16:06 xiang193

npm run demo 能跑吗

sandofsuro avatar Jun 05 '17 05:06 sandofsuro

换了版本之后 react-web init 都会失败报错

Error: Couldn't find preset "react-native" relative to directory "/Users/xiang/dev-source/java/react/abc"

xiang193 avatar Jun 05 '17 13:06 xiang193

当前版本 ➜ react npm -v 5.0.1 ➜ react node -v v8.0.0

xiang193 avatar Jun 05 '17 13:06 xiang193

之前node版本是7.6.0,前面的都跑通了,最后启动3000端口都开了,但是访问无效

xiang193 avatar Jun 05 '17 13:06 xiang193

能加个微信么?

xiang193 avatar Jun 05 '17 13:06 xiang193

cd react-web && npm install 错误挺多

4 warnings and 1 error generated.
make: *** [Release/obj.target/contextify/src/contextify.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/8.0.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:285:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Darwin 16.5.0
gyp ERR! command "/usr/local/Cellar/node/8.0.0_1/bin/node" "/usr/local/Cellar/node/8.0.0_1/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/xiang/dev-source/java/react/react-web/node_modules/contextify
gyp ERR! node -v v8.0.0
gyp ERR! node-gyp -v v3.6.1
gyp ERR! not ok
npm WARN [email protected] requires a peer of react@^15.4 but none was installed.
npm WARN [email protected] requires a peer of react-dom@^15.4 but none was installed.
npm WARN [email protected] requires a peer of react@* but none was installed.
npm WARN [email protected] requires a peer of react-dom@* but none was installed.
npm WARN [email protected] requires a peer of react@>=0.11.0 || ^0.14.0-rc but none was installed.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

xiang193 avatar Jun 06 '17 13:06 xiang193

如果你不是执意要跟这个安装过程刚下去的话,可以先用这个去跑:https://github.com/sandofsuro/NectarBoxOnWeb 配置好入口文件,用npm run demo去跑,pages里面是可以看到打包结果的。

sandofsuro avatar Jun 07 '17 09:06 sandofsuro

报错,查看原因是 node版本高, 有不降node 版本的解决方案吗,谢谢

shijinwu avatar Jun 13 '17 10:06 shijinwu