求助:新建项目出现问题
-
我是macbook10.15,英文系统,npm版本5.6.0,node版本8.11.3,全程root权限,npm install的时候出现node-sass无法安装的情况;run dev:rn的时候提示如下错误:
错误 样式预处理
Error: ENOENT: no such file or directory, scandir 'xx/node_modules/_node-sass@4.13.0@node-sass/vendor'
错误 样式转换
TypeError: Cannot read property 'toString' of undefined
请问应该怎样解决一下?谢谢
node-sass这个我用了各种方法,都是出问题,不会弄了。。
同样出问题的模块还有其他的,解决完第一个就会出现第二个第三个同样的问题。。问题如下:
npm ERR! path xx/node_modules/camelcase-keys
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'xx/node_modules/camelcase-keys'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
新建了多次都是这样。。请问怎样解决一下?谢谢
-
继续上一个问题:在init的时候并没有安装react-native的module,导致后面run的时候直接提示找不到react-native,没法跑;npm install的时候也没有安装react-native,只是提示好几个module需要安装react-native,You must install peer dependencies yourself.
-
@13691505478_p node-sass安装不上可以看这个帖子:https://taro-club.jd.com/topic/38/项目依赖安装失败-node-sass-安装不上
也可以可以看 NervJS/taro#2413
-
@Taro-小助手-honly 仍然是不行。。我重新建了个项目,提示node-sass和fsevents这两个都装不上;手动建了文件夹也是不行。我用的是macbook,您给我的那个链接是windows的
-
@13691505478_p 你换成淘宝源没
-
@Taro-小助手-honly 我之前是做RN的,RN的配置已经全部配置完毕,包括设置淘宝源和一些其他的东西;
刚才我重新建了个项目,出现以下几个问题:
1、node-sass装不上;
2、fsevents装不上;
3、以上两个用-f装上以后,npm run dev:rn 的时候提示
编译 编译完成,花费2654 ms(node:6991) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'xxx/mapp/node_modules/react-native/scripts/.packager.env' at Object.openSync (fs.js:440:3) at Object.writeFileSync (fs.js:1265:35) at startServerInNewWindow (/usr/local/Cellar/node/7.7.1_1/lib/node_modules/@tarojs/cli/dist/rn.js:368:8) at Object.<anonymous> (/usr/local/Cellar/node/7.7.1_1/lib/node_modules/@tarojs/cli/dist/rn.js:337:17) at Generator.next (<anonymous>) at fulfilled (/usr/local/Cellar/node/7.7.1_1/lib/node_modules/@tarojs/cli/dist/rn.js:4:58) 出现如上问题之后我进入到了xxx/node_modules文件夹下,没有看到任何带react词汇的文件夹和依赖模块。。
4、手动安装所有缺少的模块后,运行android时提示找不到index.android.bundle,运行iOS的时候提示找不到iPhone6的虚拟机,但是我已经安装了xcode最新版。。
第三个问题我尝试了两天了,手动安装的话会有好几个不同的模块需要安装,重新建立项目的话这些模块也不会自动安装上。。请问这个问题应该怎么解决一下?谢谢
操作系统:macbook10.15;node版本:12.13.0;npm版本:6.12.0;react-native-cli版本:2.0.1;xcode版本:11.1
-
npm 依赖安装有问题,删除重装。
-
@蜘蛛paipai 重装npm吗?还是重新建一个应用?我新建一个RN项目没有任何问题,能跑起来。。