Skip to content
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

Support linked node modules #203

Open
chriscamicas opened this issue Aug 30, 2017 · 17 comments · Fixed by #411
Open

Support linked node modules #203

chriscamicas opened this issue Aug 30, 2017 · 17 comments · Fixed by #411
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities

Comments

@chriscamicas
Copy link

When I use a linked package, and I run vsce package it fails with

Error: Command failed: npm list --production --parseable --depth=99999
npm ERR! invalid: <my_linked_package>

steps to reproduce in PowerShell:

git clone https://github.com/chriscamicas/vscode-abl.git
git clone https://github.com/chriscamicas/abl-tmlanguage.git
cd abl-tmlanguage
npm link
cd ..
cd vscode-abl
npm install
npm link abl-tmlanguage
npm run build

I'm running Windows 10 x64

@joaomoreno
Copy link
Member

There is currently no support for linked packages.

@joaomoreno joaomoreno added this to the Backlog milestone Aug 31, 2017
@KIlyaA
Copy link

KIlyaA commented Aug 8, 2018

Not work with Lerna linked packages
Error: Command failed: npm list --production --parseable --depth=99999

@joaomoreno joaomoreno added feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities labels Sep 20, 2018
@joaomoreno joaomoreno changed the title Build fails with a 'npm link'-ed package Support linked node modules Sep 20, 2018
@kaviththiranga
Copy link

I am running into same issue with a npm linked module. Did anyone find an alternative?

@chriscamicas
Copy link
Author

No solution so far, I have to link for development and unlink for the packaging to work

@kaviththiranga
Copy link

@chriscamicas can you please explain a little in depth? Once you unlink, it is not getting inside the vsix or does it?

@chriscamicas
Copy link
Author

using my previous example, my workflow is:

git clone https://github.com/chriscamicas/vscode-abl.git
git clone https://github.com/chriscamicas/abl-tmlanguage.git
cd abl-tmlanguage
npm link
cd ..
cd vscode-abl
npm install
npm link abl-tmlanguage

develop in both project
when dev is done I have to commit/push and publish to npm the second project abl-tmlanguage
Then I have to install this dependency like any other one in the main project, after removing the link

npm unlink abl-tmlanguage
npm install abl-tmlanguage
npm run build

@kaviththiranga
Copy link

@chriscamicas thanks a lot for the explanation. In my case, we haven't published the module yet to npm :(.

@chriscamicas
Copy link
Author

A better tutorial explaining how to use npm link
https://medium.com/dailyjs/how-to-use-npm-link-7375b6219557

@b4ckup
Copy link

b4ckup commented May 23, 2019

Any progress on this? I develop a vscode extension that depends on a package I develop. Right now I have to push to npm in order to build a local .vsix file. Is there any solution to this? Is there a reason not to use

npm list --production --parseable --depth=99999 --link=true

with the link=true parameter?
What difference does it make to vsce where the node module comes from when packaging as long as it is in the node_modules folder?

@TheZoker
Copy link

Same issue here...

Why is the --link=true not included per default? Solved the issue

@joaomoreno joaomoreno removed this from the Backlog milestone Oct 11, 2019
felixhao28 added a commit to felixhao28/vscode-vsce that referenced this issue Dec 25, 2019
@joaomoreno joaomoreno added this to the January 2020 milestone Jan 13, 2020
@joaomoreno joaomoreno self-assigned this Jan 29, 2020
@joaomoreno joaomoreno added the verification-needed Verification of issue is requested label Jan 29, 2020
@RMacfarlane
Copy link

@joaomoreno Looks like the fix for this was reverted, I can still repro the problem when running out of sources

@RMacfarlane RMacfarlane reopened this Jan 29, 2020
@RMacfarlane RMacfarlane added the verification-found Issue verification failed label Jan 29, 2020
@joaomoreno
Copy link
Member

joaomoreno commented Jan 30, 2020

🤦‍♂️ Completely forgot that it was. Thanks for reopening.

@joaomoreno joaomoreno removed verification-found Issue verification failed verification-needed Verification of issue is requested labels Jan 30, 2020
@joaomoreno joaomoreno removed this from the January 2020 milestone Jan 30, 2020
@kevinslin
Copy link

any updates on this? i'm running into this issue as well when packaging my extension locally

@SPGoding
Copy link

SPGoding commented Jul 7, 2020

According to the doc, --link=true makes it only list linked dependencies, I guess that's the reason why the test failed.

No idea on how to do it the right way.

@Lonli-Lokli
Copy link

So is there any way/readme to build vsix with local packages inside lerna repository?

@prmichaelsen
Copy link

Is there any way around this? I'm building an extension locally with no intent to publish any of the packages or the extension itself.

@bytemain
Copy link

You can write a script running npm i before vsce package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

Successfully merging a pull request may close this issue.