nickdodd79 / vscode-gulptasks

A gulp task visualization and execution extension for Visual Studio Code
MIT License
7 stars 6 forks source link

Error on package.json #22

Closed simoneldevig closed 5 years ago

simoneldevig commented 6 years ago

Hi,

I'm getting this error when trying to load Gulp Tasks.

The path to the gulpfile.js is correct but package.json is located in the same location under /scaffold

Loading gulp tasks...
ERROR: Command failed: gulp --tasks-simple --cwd "c:\Sites\SITECORE\[PROJECT_ROOT]" --gulpfile "c:\Sites\SITECORE\[PROJECT_ROOT]\scaffold\gulpfile.js"
fs.js:641
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open 'c:\Sites\SITECORE\[PROJECT_ROOT]\package.json'
    at Error (native)
    at Object.fs.openSync (fs.js:641:18)
    at Object.fs.readFileSync (fs.js:509:33)
    at Object.<anonymous> (c:\Sites\SITECORE\S_SC_Plantorama\scaffold\gulp\app.js:26:26)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
nickdodd79 commented 6 years ago

Hi @simoneldevig

I suspect this could be an expectation that gulp has with regards to a package.json. I will do some investigation to reproduce, find out why and see if a update can be put in place.

Watch this space.

Nick.

simoneldevig commented 6 years ago

Thx @nickdodd79 :-)

nickdodd79 commented 5 years ago

Hi @simoneldevig

Apologies for the delay. I have attempted several approaches to replicating your issue and everything works for me. Though for nested package.json files and node_modules a global gulp install is required.

I am suspecting the issue is related to the binding.open(...) call attempting to find your package.json for what ever reason. You may have to add a dummy package.json to your project root to satisfy that invocation.

Nick.

nickdodd79 commented 5 years ago

Closing due to no follow up.