加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

React Native创建项目时报错:npm ERR! Windows_NT 10.0.10240 错

发布时间:2020-12-15 08:25:19 所属栏目:百科 来源:网络整理
导读:1.问题描述 React Native创建项目时报一堆的错: spawn-sync@1.0.15 postinstall D:RN_Androidapp_projectsfendonode_modulesreact-nativenode_modulesyeoman-generatornode_modulescross-spawnnode_modulesspawn-sync node postinstall npm WARN

1.问题描述


React Native创建项目时报一堆的错:


spawn-sync@1.0.15 postinstall D:RN_Androidapp_projectsfendonode_modulesreact-nativenode_modulesyeoman-generatornode_modulescross-spawnnode_modulesspawn-sync
> node postinstall


npm WARN peerDependencies The peer dependency react@~15.3.1 included from react-native will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated cross-spawn-async@2.2.4: cross-spawn no longer requires a build toolchain,use it instead!
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:sowafortnodejsnode.exe" "C:sowafortnodejsnode_modulesnpmbinnpm-cli.js" "install" "--save" "--save-exact" "react-native"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! path C:UsersfendoAppDataRoamingnpm-cachebabel-traverse6.16.0package.tgz.1360063874
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename


npm ERR! Error: EPERM: operation not permitted,rename 'C:UsersfendoAppDataRoamingnpm-cachebabel-traverse6.16.0package.tgz.1360063874' -> 'C:UsersfendoAppDataRoamingnpm-cachebabel-traverse6.16.0package.tgz'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted,rename 'C:UsersfendoAppDataRoamingnpm-cachebabel-traverse6.16.0package.tgz.1360063874' -> 'C:UsersfendoAppDataRoamingnpm-cachebabel-traverse6.16.0package.tgz']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:UsersfendoAppDataRoamingnpm-cachebabel-traverse6.16.0package.tgz.1360063874',
npm ERR! dest: 'C:UsersfendoAppDataRoamingnpm-cachebabel-traverse6.16.0package.tgz',
npm ERR! parent: 'babel-plugin-transform-es2015-classes' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.


npm ERR! Please include the following file with any support request:
npm ERR! D:RN_Androidapp_projectsfendonpm-debug.log



`npm install --save --save-exact react-native` failed


2.解决方法


由于我是win10的系统,并没有用管理员运行Dos所以他才会报错,win+x然后以管理员运行Dos就行了。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读