Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module Not Found from git url dependency

I have forked react-flexbox-grid to add support for hidden-columns (this is my first time contributing) but I'm unable to include the package in my project.

Per the Docs: Git Urls as Dependencies, I put the following in my package.json:

    "react-flexbox-grid": "falieson/react-flexbox-grid#hidden-columns",

After running npm i, I see that npm fetched and had no errors installing the package.

├── [email protected] ├── [email protected] (git://github.com/falieson/react-flexbox-grid.git#f8e9e9053430b619f4c7fd79b90ccd4f44d6a05c) ├── [email protected]

But when I start the server meteor:webpack complains:

ERROR in ./imports/ui/Home/index.jsx Module not found: Error: Cannot resolve module 'react-flexbox-grid' in /Users/falieson/Code/planetx-boilerplate/imports/ui/Home

I haven't changed anything on the index.jsx

import {Grid, Row, Col} from 'react-flexbox-grid';

Here's my meteor webpack config:

{
 "css": {
   "module": true
 },
 "module": {
   "loaders": [
     {
       "test": "/\\.css$/",
       "loader": "style!css?modules",
       "include": "/flexboxgrid/"
     }
   ]
 }
}
like image 443
Falieson Avatar asked Dec 23 '16 21:12

Falieson


2 Answers

  1. Make sure your compiled files are in the commit.
  2. Make sure git ignore is updated to not ignore you compiled files.
  3. npm rm -rf ./node_modules/xxxx if module is already installed
  4. npm install --save-dev https://gitlab.com/m_farhan/xxxxx.git#master
  5. make sure you build your code before pushing it to repo.
  6. npm xxxxx update your project.
like image 31
m-farhan Avatar answered Nov 09 '22 12:11

m-farhan


The issue is that this repo need to be build, the package.json is refering to the ./lib/index.js file but it doesn't exists in the repo (only src folder).

You can build it localy with:

npm run compile

and force add and push the ./lib folder to your git repo.

like image 126
Lucas Zientek Avatar answered Nov 09 '22 13:11

Lucas Zientek