How to install NPM package from GitHub for Meteor?

I unblocked the npm package on GitHub, made changes to it and now I want to install the package in my Meteor application directly from GitHub.

My package.json looks like this:

{
  "dependencies": {    
    "semantic-ui-react": "git+https://git@github.com/nolandg/Semantic-UI-React.git",
  }
}

Then i ran

meteor npm install

Which seems to work fine and tells me that he installed the package:

semantic-ui-react@0.61.6  (git+https://git@github.com/nolandg/Semantic-UI-React.git#f27d5c736e5de1eed0acf7769f18caee57578526)

Indeed, the package appears in the node_modules folder. But when I try to start the Meteor application, I get this error:

Cannot set property '/my-website/node_modules/semantic-ui-react/package.json' of undefined

at Resolver._resolvePkgJsonMain (/tools/isobuild/resolver.js:320:9)

Has anyone successfully installed the npm package in a Meteor application directly from GitHub? I can not understand this. Thank!

Meteorite version: 1.4.2.3

+4
source share
3 answers

, git, . Meteor, , JS.

:

  • files package.json src dist. , npm , , .
  • . , npm, github, .

, package.json, ( , , ), github npm:

// remove the "files" field
// ...
"scripts": {
  // this script is used to build the package
  "postinstall": "postinstall-build dist \"npm run build:commonjs\""
  // ...
},
"dependencies": {
  // this helps build the package
  "postinstall-build": "^2.1.3"
},
// ...
+3

github, , , , , . , , , , , , .

github, npm-, , , npm. . https://docs.npmjs.com/cli/link

0

?

  meteor npm install https://github.com/nolandg/Semantic-UI-React.git

:

  meteor create test
  cd test
  meteor npm install
  meteor add react react-dom
  meteor npm install https://github.com/nolandg/Semantic-UI-React.git
  meteor

(-:

0

Source: https://habr.com/ru/post/1662226/


All Articles