-
Notifications
You must be signed in to change notification settings - Fork 845
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
Gulpfile.js failed to load in Task Runner Explorer(VS2015.1) #247
Comments
I had similar problem some time ago, but then it just started working without changes in gulpfile.js. I suspect that some (solution, Visual Studio) restarting or Task Runner Explorer panel reopening did the trick. |
When I do a manual 'Restore packages' on the package.json in the VirtoCommerce.Platform.Web project it gives me also errors, which, when on google, suggested updating NPM/Node first. When checkin the versions in Package Manager Console in VS it listed:
Just updated last week to VS2015 update 1(gruntfile also didn't load with old version of VS2015), so all should be up-to-date but 2.7.4(Node) and 0.12.2(Node) isn't exactly a new version(NPM: March 20, 2015, Node: April 1, 2015) So it looks like MS isn't updating there Node/NPM versions? There are ways to guide VS to use other versions of Node/NPM, and not messing with the MS tooling: http://jameschambers.com/2015/09/upgrading-npm-in-visual-studio-2015/ But first I'm curious what versions your VS is listing? Maybe my external tooling isn't up-to-date. |
So I updated NPM using this sublime npm upgrade package: https://github.com/felixrieseberg/npm-windows-upgrade to 3.5.3(latest stable release) Directed VS to use the global node/npm versions, in Tools\Options, than Projects and Solutions\External Web Tools; Added an entry C:\Program Files (x86)\nodejs and moved it to the top: Cleaned the npm modules cache(npm cache clean) because there were some crippled packages in it, removed the node_modules/client_packages in the VirtoCommerce.Platform.Web folder and restarted VS. Than all went smooth and the Task Runner Explorer is showing the tasks: Another advantage of the updated NPM is that as of NPM version 3.0.0, all the packages are stored in a flat folder structure, avoiding the Windows long-filename/path problems with the sometimes awfully deeply nested node_modules folders and Windows explorer unable to remove them. Nice! Hope to help someone else with this walk through :) Do you want me to close the issue? |
@eMazeika I also think I have an idea what happened what you were describing. When you open the solution for the first time there are no client_packages and node_modules folders, there are made when VS discovers the bower.js and package.json. When the Task Runner finds(and processes it to find the tasks) the gulpfile.js before the all the packages(node_modules;client_packages) are restored it displays the same error: failed to load, see output window etc. When you reactivate(reload solution, reactivate the tab etc) the Task Runner(after all packages are restored) and it processes the gulpfile again, it can find all it's dependencies and shows the task correctly. |
nicely done, @jvdonk !
I did install nodejs and npm separately and included them to Windows environment path. |
1+ for @jvdonk answer! Thanks |
or (if your source code has not been upgraded)
|
When the VirtoCommerce.Platform.sln is opened, VS(or it's extensions) is successfully picking up the bower.json and package.json and restoring all of its dependencies.
So when it's done, if have the dependencies installed which weren't there before I opened the solution:
The dependencies for the gulpfile.js seems to be there but in the Task Runner Explorer window in VS there is an error that it failed to load the Gulpfile.js, more info in the Output-window:
Surely enough it's a local issue, but as I'm fairly new to using task runners: gulp/grunt (I get the concept of task runners etc, just never used them in my projects), I can't seem to find the problem why the Task Runner Explorer isn't liking the gulpfile.js.
If there is another way of building the allPackages.js(for example) than that's fine too. It doesn't have to be the Task Runner Explorer, it's now just the only place I can think of to produce the output of the gulpfile tasks.
The text was updated successfully, but these errors were encountered: