当我尝试使用命令安装 React Native 时react-native init ProjectName
我得到以下信息:
This will walk you through creating a new React Native project in C:\Users\Xegano\Documents\ProjectName
Installing react-native package from npm...
Setting up new React Native app in C:\Users\Xegano\Documents\ProjectName
module.js:457
throw err;
^
Error: Cannot find module './src/init'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\Xegano\Documents\ProjectName\node_modules\gulp-sourcemaps\index.js:4:9)
at Module._compile (module.js:556:32)
at Module._extensions..js (module.js:565:10)
at Object.require.extensions.(anonymous function) [as .js] (C:\Users\Xegano\Documents\ProjectName\node_modules\babel-register\lib\node.js:152:7)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
为什么会出现这种情况?它以前可以工作,我记得我唯一改变的是 SDK 管理器中的一些包。会是这样吗?
实际上它在我的情况下有效,但我需要将 gulp-sourcemaps 降级到版本 1.7
$ cd MyProject
$ rm -rf node_modules/gulp-sourcemaps
$ npm install [email protected]
$ cd ..
$ react-native init MyProject
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)