Skip to content
New issue

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

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

Already on GitHub? # to your account

Add Npm to 'Path' of NodeTask #134

Closed
cdietrich opened this issue Aug 11, 2016 · 5 comments · Fixed by #179
Closed

Add Npm to 'Path' of NodeTask #134

cdietrich opened this issue Aug 11, 2016 · 5 comments · Fixed by #179
Milestone

Comments

@cdietrich
Copy link

Running on a machine with no node/npm installed

When i execute a NodeTask calling a Module that calls Npm via exec then it wont find npm / use the destroyed symlink extracted. thus it would be nice if this would work out of the box instead of using

task npmInstallNpm(type: NpmTask, dependsOn: npmSetup) {
    group 'Node'
    description 'Installs NPM"'
    args = [ 'install', '-g', 'npm' ]
}

here is what the node module vsce does (one of may npm calls)

require('child_process').exec('npm -v' ....)
@Hildebrand
Copy link

This is indeed an issue. The yeoman doctor (part of the yo NPM package) also does a version check that fails if being ran from the gradle-node locally installed Node. To be precise, it's this file: https://github.com/yeoman/doctor/blob/master/lib/rules/npm-version.js failing to find npm.

as I have npm installed globally already I wonder if @cdietrich solution will help..

@srs srs added node and removed node labels Dec 4, 2016
@cbornet
Copy link

cbornet commented Dec 12, 2016

👍 I also have the yo package installation failure.

@cbornet
Copy link

cbornet commented Dec 12, 2016

To reproduce very easily:

./gradlew npm_install_yo

@cbornet
Copy link

cbornet commented Dec 14, 2016

Looks like the same issue as #146 introduced by yarn support in 0.14
Downgrading to 0.13 fixes it (but you lose yarn support 😞 )

@s0x
Copy link
Contributor

s0x commented Dec 14, 2016

This is related to #164 and would be fixed by MR #165

s0x added a commit to s0x/gradle-node-plugin that referenced this issue Dec 19, 2016
This closes srs#164, closes srs#149, closes srs#146 and closes srs#134
@srs srs closed this as completed in #179 Jan 13, 2017
@srs srs added this to the 1.1.0 milestone Jan 13, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants