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

Check for npm on path variable in NpmHelper on Windows #1371

Merged
merged 1 commit into from
Sep 5, 2016
Merged

Check for npm on path variable in NpmHelper on Windows #1371

merged 1 commit into from
Sep 5, 2016

Conversation

nikolaia
Copy link
Contributor

People on a team have npm in different locations, and the easiest way for the NpmHelpe to work out of the box would be to pick the location of the path-variable. It is painful to handle this manually when we have several projects.

In our projects we do it like this at the moment, but I could not get file globbing to work inside NpmHelper.fs:

System.Environment.GetEnvironmentVariable("PATH")
|> fun path -> path.Split ';'
|> Seq.append [ @"c:/programdata/scoop/apps/nodejs/"
                @"c:/program Files/nodejs/"
                @"c:/program Files (x86)/nodejs/"
                @"./packages/Npm.js/" ]
|> Seq.map (findToolInSubPath "npm.cmd")
|> Seq.tryFind fileExists
|> function
    | Some r -> r
    | None -> failwith "Unable to locate npm.cmd - if you have npm.cmd in a weird location you'll have to add it to the list in build.fsx. We tried looking in your PATH and some standard locations."

Some input would be greatly appreciated!

cc @mastoj

@forki forki merged commit 7e2886b into fsprojects:master Sep 5, 2016
@forki
Copy link
Member

forki commented Sep 5, 2016

thx

@nikolaia nikolaia deleted the f_npmhelper_npmfilelocation branch September 5, 2016 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants