gulp-sourcemaps:找不到模块'./src/init' [英] gulp-sourcemaps: Cannot find module './src/init'

查看:15
本文介绍了gulp-sourcemaps:找不到模块'./src/init'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在安装 React-native 时遇到错误,我试图搜索答案,但找不到.

I get an error while installing React-native, I have tried to search for an answer, but I can not find one.

运行react-native init meet"时出现此错误:

When running "react-native init meet" I get this error:

    This will walk you through creating a new React Native project in /Users/alfred/React/meet
Installing react-native package from npm...
Setting up new React Native app in /Users/alfred/React/meet
module.js:338
    throw err;
    ^

Error: Cannot find module './src/init'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/alfred/React/meet/node_modules/react-native/node_modules/yeoman-generator/node_modules/download/node_modules/vinyl-fs/node_modules/gulp-sourcemaps/index.js:4:9)
    at Module._compile (module.js:434:26)
    at Module._extensions..js (module.js:452:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/alfred/React/meet/node_modules/react-native/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)

我真的不明白这是怎么回事......

I don't really get what is wrong...

推荐答案

这与 gulp-sourcemaps 最近部署的问题有关 https://github.com/floridoo/gulp-sourcemaps/issues/238

It's related to an issue with gulp-sourcemaps recent deployment https://github.com/floridoo/gulp-sourcemaps/issues/238

项目维护人员在帖子结束时说,他今天会处理它,并且

A project maintainer says at the end of the thread that he'll get to it today and

暂时将您的版本锁定为 2.0.x 或 1.7.x

For the time being lock your version down to 2.0.x or 1.7.x

要修复,请在您的 package.json 中添加特定版本,直到问题得到修复:

To fix, add specific version in your package.json until the issue is fixed:

{
  "devDependencies": {
    "gulp-sourcemaps": "1.7.x"
  }
}

使用 npm shrinkwrap 防止将来出现类似问题.

Use npm shrinkwrap to prevent similar issues in the future.

这篇关于gulp-sourcemaps:找不到模块'./src/init'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆