New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use a local npm package with npm link #2876

Closed
rbabayoff opened this Issue Oct 20, 2014 · 10 comments

Comments

Projects
None yet
7 participants
@rbabayoff
Contributor

rbabayoff commented Oct 20, 2014

Hey,

My use case is as follows - I have an npm package that my meteor package depends on that I link globally using:

sudo npm link

Problem is that when I try to run my app, meteor complains that it cannot find the npm package in the npm registry:

spacejam version 1.1.0 is not available in the npm registry

This makes it hard to develop wrapper packages for npm packages, since I'll need to push my changes every time to the npm registry in order to use and test my meteor wrapper package.

Workarounds, for now, would be appreciated.

Ronen

@rbabayoff

This comment has been minimized.

Contributor

rbabayoff commented Oct 20, 2014

Tried to create a symlink to my npm package in .npm/package/node_modules but didn't work either.

@glasser

This comment has been minimized.

Member

glasser commented Oct 21, 2014

You're right, we don't support that.

We do not use GitHub to track feature requests (other than for Blaze). The core team's current roadmap is at https://roadmap.meteor.com/. Discussions about features that users desire are great topics for the meteor-talk mailing list, where the community can help come up with solutions that don't require core changes.

Workaround: put it on some http/https URL with a SHA in it, I guess :)

@glasser glasser closed this Oct 21, 2014

@rbabayoff

This comment has been minimized.

Contributor

rbabayoff commented Oct 22, 2014

@glasser can you elaborate on the https url with a sha in it? Specifically, for pulling it from github? The Npm.depends needs to include a from field?

@rbabayoff

This comment has been minimized.

Contributor

rbabayoff commented Oct 22, 2014

Disregard, I'm just using --tag in my npm publish to not list it or tag it as latest

@trusktr

This comment has been minimized.

Contributor

trusktr commented Dec 30, 2015

@benjamn @glasser It'd be super awesome if the new modules system in 1.3 supports linked packages (if it doesn't already).

@mizzao

This comment has been minimized.

Contributor

mizzao commented Apr 6, 2016

Hey guys --- is it possible yet to do development on an NPM package as part of a Meteor app, like we do Meteor packages, using something like npm link?

Currently, if a NPM package has a bug (when used as part of a Meteor app) that we'd like to fix and submit a PR on, it's very difficult to set up a development version.

Related: https://forums.meteor.com/t/npm-depends-on-a-local-npm-package/9177/2

@benjamn

This comment has been minimized.

Member

benjamn commented Apr 6, 2016

I don't know why npm link wouldn't work for local node_modules directories, and if you're developing a Meteor package you can import npm packages from the app's top-level node_modules directory as "peer" dependencies. Give that a try?

@trusktr

This comment has been minimized.

Contributor

trusktr commented Apr 6, 2016

@mizzao npm link works fine for me. I'm using that right now to develop a NPM package while testing it in a Meteor app.

@kctang

This comment has been minimized.

kctang commented Apr 15, 2016

@mizzao fyi, i faced a similar situation today. After being puzzled for a while, I realised that the package's entry point was babel transpiled code. So, changing the package's (ES6) source alone will not make any difference. Run the package's "build script" ...then Meteor will pick up the changes. Hope this helps.

benjamn added a commit that referenced this issue Nov 4, 2016

Use absolute paths for external symlinks in Builder#copyDirectory.
Thanks to @worldsayshi for reporting this issue with a reproduction.

Fixes #8005.
Fixes #2876.
Fixes #7154.
@cesarve77

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment