Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gulp-sourcemaps: Cannot find module './src/init'

Tags:

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

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...

like image 485
rablentain Avatar asked Oct 13 '16 21:10

rablentain


People also ask

Can not find module Gulp?

Install the gulp-sass module manually If you don't see the gulp-sass package in your node_modules folder, or are still having issues, you can try reinstalling the package. First, open your package. json and package-lock. json files and remove any references to gulp-sass and node-sass that you see.

What is Sourcemaps Gulp?

It automatically creates source maps from your code. A source map is used to tell you which file and line in your original code a part of minified code comes from.


1 Answers

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

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

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

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

Use npm shrinkwrap to prevent similar issues in the future.

like image 81
commandt Avatar answered Nov 02 '22 05:11

commandt