mastoj / FAKESimpleDemo

My simple demo project for fake
6 stars 4 forks source link

npm run fails #1

Open johnkors opened 8 years ago

johnkors commented 8 years ago

Executing build.cmd web., I get this error ((I have no global node installed)

node-notifier@4.4.0 node_modules\node-notifier
├── shellwords@0.1.0
├── growly@1.2.0
├── minimist@1.2.0
├── semver@4.3.6
├── which@1.2.1 (is-absolute@0.1.7)
├── lodash.clonedeep@3.0.2 (lodash._bindcallback@3.0.1, lodash._baseclone@3.3.0)
└── cli-usage@0.1.2 (minimist@0.2.0, marked@0.3.5, marked-terminal@1.6.1)

C:\code\frontend\FAKESimpleDemo\packages\Npm.js\tools\npm.cmd run build

> FAKESimple.Web@1.0.0 build C:\code\frontend\FAKESimpleDemo\src\FAKESimple.Web
> gulp js:app

'node' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\code\\frontend\\FAKESimpleDemo\\packages\\Node.js\\node.exe" "C:\\code\\frontend\\FAKESimpleDemo\\packages\\Npm.js\\tools\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v5.3.0
npm ERR! npm  v2.13.1
npm ERR! code ELIFECYCLE
npm ERR! FAKESimple.Web@1.0.0 build: `gulp js:app`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the FAKESimple.Web@1.0.0 build script 'gulp js:app'.
npm ERR! This is most likely a problem with the FAKESimple.Web package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp js:app
npm ERR! You can get their info via:
npm ERR!     npm owner ls FAKESimple.Web
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\code\frontend\FAKESimpleDemo\src\FAKESimple.Web\npm-debug.log
johnkors commented 8 years ago

I get this error as well when using the NpmHelper ( http://fsharp.github.io/FAKE/apidocs/fake-npmhelper.html ) and executing npm run

mastoj commented 8 years ago

do you mean when you run npm run from the command line?

johnkors commented 8 years ago

Ah, no. When running the FAKE script via build.cmd web.

johnkors commented 8 years ago

Is this in use, btw?

https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/NpmHelper.fs#L28

mastoj commented 8 years ago

It doesn't seem to be in use, no :). Probably something I forgot to remove before I submitted that PR. I'll try to build the project locally.

johnkors commented 8 years ago

Something to do with this?

C:\code\frontend\FAKESimpleDemo\src\FAKESimple.Web\node_modules\.bin (master)
λ gulp

'node' is not recognized as an internal or external command,
operable program or batch file.
mastoj commented 8 years ago

it looks like even though the initial node.exe from the right place is used, it looks like gulp refers to the global version. Maybe the path to node.exe must be added to the path environment variable when you run it. Good catch though. Please fix if you're working on it, otherwise I'll do it when I have time :).

johnkors commented 8 years ago

Yeah, might have to add node.exe to PATH at the time of install via NuGet (in the build.cmd). Not sure if it will be able to resolve it from PATH immediately, though..

mastoj commented 8 years ago

I think it is better to add it temporarily when you run the command just for that process. Otherwise you might end up corrupt an existing installation of node, which you might want to have.

On Tue, Jan 12, 2016 at 12:31 PM, John Korsnes notifications@github.com wrote:

Yeah, might have to add node.exe to PATH at the time of install via NuGet (in the build.cmd). Not sure if it will be able to resolve it from PATH immediately, though..

— Reply to this email directly or view it on GitHub https://github.com/mastoj/FAKESimpleDemo/issues/1#issuecomment-170883180 .

johnkors commented 8 years ago

in the lines of?

NuGet.exe "Install" "Node.js" "-OutputDirectory" "packages" "-ExcludeVersion"
SET NodeJsPath=%~dp0packages\Node.js
SET PATH=%PATH%;%NodeJsPath%
johnkors commented 8 years ago

That seemed to solve it. Now gulp is able to get node using the Nugetly installed version of Node :)

mastoj commented 8 years ago

Awesome, I wonder what is the best version to solve that issue... it's more a problem with node/npm and how some packages internally do a new call to node that's in the path for some reason.

On Tue, Jan 12, 2016 at 12:59 PM, John Korsnes notifications@github.com wrote:

That seemed to solve it. Now gulp is able to get node using the Nugetly installed version of Node :)

— Reply to this email directly or view it on GitHub https://github.com/mastoj/FAKESimpleDemo/issues/1#issuecomment-170890414 .