GithubHelp home page GithubHelp logo

Comments (5)

nygardk avatar nygardk commented on May 14, 2024

Hi,

npm run <command> should use locally installed packages (i.e. from the project's node_modules). The dependencies are listed under devDependencies.

Can you post the error you get? And which versions of NPM and Node.js you are using?

Babel-plugin-transform was accidentally in devDependencies. I will fix that.
babel-plugin-transform-class-properties is not in devDependencies, and might be needed with older NPM versions.

from react-share.

matthewoates avatar matthewoates commented on May 14, 2024

Thanks for the quick reply. Looks like the first error tripped me up locally and I assumed the following packages needed to be installed globally by inspecting the package.json file.

However, whenever I run npm link after successfully running npm run-script build in react-share, in the project that is linking to this library I get the following webpack error:

ERROR in ../react-share/lib/react-share.js
Module build failed: ReferenceError: Unknown plugin "syntax-flow" specified in "base" at 0, attempted to resolve relative to "/home/matt/workspace/react-share/lib"
    at /home/matt/workspace/boardom/node_modules/babel-core/lib/transformation/file/options/option-manager.js:220:17
    at Array.map (native)
    at Function.normalisePlugins (/home/matt/workspace/boardom/node_modules/babel-core/lib/transformation/file/options/option-manager.js:196:20)
    at OptionManager.mergeOptions (/home/matt/workspace/boardom/node_modules/babel-core/lib/transformation/file/options/option-manager.js:317:36)
    at OptionManager.init (/home/matt/workspace/boardom/node_modules/babel-core/lib/transformation/file/options/option-manager.js:506:10)
    at File.initOptions (/home/matt/workspace/boardom/node_modules/babel-core/lib/transformation/file/index.js:243:89)
    at new File (/home/matt/workspace/boardom/node_modules/babel-core/lib/transformation/file/index.js:159:72)
    at Pipeline.transform (/home/matt/workspace/boardom/node_modules/babel-core/lib/transformation/pipeline.js:49:16)
    at transpile (/home/matt/workspace/boardom/node_modules/babel-loader/index.js:14:22)
    at /home/matt/workspace/boardom/node_modules/babel-loader/lib/fs-cache.js:145:18
    at ReadFileContext.callback (/home/matt/workspace/boardom/node_modules/babel-loader/lib/fs-cache.js:28:23)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:303:13)
 @ ./client/src/js/ui/react/components/Social.js 13:18-40

How is this any different than the built assets from npm install react-share?

from react-share.

matthewoates avatar matthewoates commented on May 14, 2024
~/workspace/react-share
~/workspace/react-share
 ➤ npm --version
2.14.12
~/workspace/react-share
 ➤ node --version
v4.3.1

Pretty new versions of npm and node. In my project I'm using babel-core @ 6.9.0

from react-share.

nygardk avatar nygardk commented on May 14, 2024

Your NPM version is rather old. NPM has had major changes since v2.x regarding how it deals with nested dependencies. Node.js v4 is fine.

I would suggest you to run npm install -g npm to upgrade to the newest version, and then try again.

If that doesn't help, try running npm cache clean && npm prune && npm install in the project folder.

Simply running npm install && npm run run-demos should get you up and running in the ideal case!

from react-share.

matthewoates avatar matthewoates commented on May 14, 2024

Simply running npm install && npm run run-demos should get you up and running in the ideal case!

That's the dream.

Anyway, npm install babel-plugin-syntax-flow in react-share fixed the issue locally for me. I've cloned the repo to add a disabled state. I'll send the PR your way.

from react-share.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.