ahmadawais / WPGulp

An advanced Gulp workflow for WordPress development with extensive documentation. Used by 40,000+ themes and plugins.
https://twitter.com/MrAhmadAwais/
MIT License
1.77k stars 303 forks source link

Error installing, command failed #112

Closed saltnpixels closed 5 years ago

saltnpixels commented 6 years ago

Bug Report

I get an error when I try and install it The error is

 throw err;
        ^
Error: Command failed: npm install --silent

I am using the latest versions of node and npm. I am on a Mac OS

ahmadawais commented 6 years ago

@saltnpixels still having this issue? Kindly report through the original bug report issue and answer all the questions there so that I know which version of what you are using 👍 Just copy paste the template from a new issue below :).

Looking forward!

ahmadawais commented 6 years ago

npm install --silent should work. Can you test npm install --silent wpgulp on that computer to see if it has an npm issue?

saltnpixels commented 6 years ago

So npm install --silent wpgulp does work. But when I run npx wpgulp the issue still comes up. Error:

Installing npm packages.../Users/ericgreenfield/.npm/_npx/8327/lib/node_modules/wpgulp/installer/index.js:34
        throw err;
        ^

Error: Command failed: npm install --silent

    at makeError (/Users/ericgreenfield/.npm/_npx/8327/lib/node_modules/wpgulp/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/Users/ericgreenfield/.npm/_npx/8327/lib/node_modules/wpgulp/node_modules/execa/index.js:278:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
ahmadawais commented 6 years ago

It looks like npm install --silent command is failing. This could also be a permissions issue. Can you run sudo npx wpgulp and report back?/

saltnpixels commented 6 years ago

Even with sudo it fails. :/

ahmadawais commented 6 years ago

I need the error message. I can't help you wihtout it.

saltnpixels commented 6 years ago

It is the same error as above even with sudo

ahmadawais commented 6 years ago

Can you try the beta? Run:

npx wpgulp@2.6.1-beta.0

and report back?

saltnpixels commented 6 years ago

Here are the errors from using 2.6.1-beta

Installing npm packages.../Users/ericgreenfield/.npm/_npx/8953/lib/node_modules/wpgulp/installer/index.js:34
        throw err;
        ^

Error: Command failed: npm install
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN your-project@1.0.0 No repository field.

npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ericgreenfield/.npm/_logs/2018-09-14T14_33_30_023Z-debug.log

    at makeError (/Users/ericgreenfield/.npm/_npx/8953/lib/node_modules/wpgulp/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/Users/ericgreenfield/.npm/_npx/8953/lib/node_modules/wpgulp/node_modules/execa/index.js:278:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
saltnpixels commented 6 years ago

I was able to run it successfully on another computer. Then I copied it to the problem computer and tried running npm start.

Here is the error I get when i do that:

module.js:550
    throw err;
    ^

Error: Cannot find module 'gulp-cli'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/ericgreenfield/Dropbox/projects/sites/ignition/app/public/wp-content/themes/ignition/node_modules/.bin/gulp:3:1)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! your-project@1.0.0 start: `gulp`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the your-project@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ericgreenfield/.npm/_logs/2018-09-14T15_14_06_428Z-debug.log

Does that help at all?

I tried updating npm, node and gulp on the global level but still it wont work right.

ahmadawais commented 6 years ago

Well, it's definitely your computer's issues. Coz now it's not installing modules from npm install. I thought maybe --silent was casuing it.

My guess is create-guten-block would also not work on your problem computer. Can you try that and report back. Coz. it works for everyone and I am using the same installer for WPGulp.

Looking forward!

ahmadawais commented 6 years ago

Also, latest version of WPGulp doesn't require a global installation of gulp. That caused issues in the previous versions.

saltnpixels commented 6 years ago

I deleted the node_modules folder and everything and started over and now it works... im confused... Maybe updating gulp helped? But you said it didn't need to be installed globally. I dunno....

Now I will test it on the other computer where it was working before!

ahmadawais commented 6 years ago

For sure it was an issue of your npm's permissions inside the node-modules. Can you now try the regular one i.e. npx wpgulp and report back before we close this. I'll add it to FAQs.

saltnpixels commented 6 years ago

Yes the regular npx wpgulp did work.
Thanks.

--
Eric Greenfield

On September 14, 2018 at 3:13:58 PM, Ahmad Awais ⚡️ (notifications@github.com(mailto:notifications@github.com)) wrote:

For sure it was an issue of your npm's permissions inside the node-modules. Can you now try the regular one i.e. npx wpgulp and report back before we close this. I'll add it to FAQs.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub(https://github.com/ahmadawais/WPGulp/issues/112#issuecomment-421457463), or mute the thread(https://github.com/notifications/unsubscribe-auth/ALE88hHXi7mig_YD7d7PIX1AE8njNb9Bks5ua__2gaJpZM4Wn4nn).

ahmadawais commented 6 years ago

That's it then. I'll add remove node_modules to the list of upgrade method.

jurdanetacom commented 5 years ago

Hi @saltnpixels , I'm having the same exact problem than you:

In the directory: E:\temp\npmtest4 This might take a couple of minutes.

√ 1. Creating WPGulp files inside → E:\temp\npmtest4 \ 2. Installing npm packages...C:\Users\CH3\AppData\Roaming\npm-cache_npx\8600\node_modules\wpgulp\installer\index.js:34 throw err; ^

Error: Command failed: npm install --silent

at makeError (C:\Users\CH3\AppData\Roaming\npm-cache\_npx\8600\node_modules\wpgulp\node_modules\execa\index.js:174:9)
at Promise.all.then.arr (C:\Users\CH3\AppData\Roaming\npm-cache\_npx\8600\node_modules\wpgulp\node_modules\execa\index.js:278:16)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)

I read that you deleted "node_modules", so I uninstalled Node, and deleted \AppData\Roaming\npm-cache\ and \AppData\Roaming\npm\ folders, then reinstalled node.js but then I'm getting the same error.

Is there any other folder I'm missing?

Thanks

NPM: 6.4.1 NODE: 8.12.0 Windows 10

ahmadawais commented 5 years ago

@jurdanetacom can you delete the node_modules folder inside your project and run npm install again?

jurdanetacom commented 5 years ago

@ahmadawais there isn't a node_modules folder inside the project folder, you mean in \AppData ?

tarfoot commented 5 years ago

I'm having the same issue with npx start even when starting in a completely empty folder. But npm install --silent wpgulp works.

NODE: 10.12.0 NPM: 6.4.1 MACOS: 10.12.6


running npx wpgulp:

Downloading WPGulp files in: → tmp

In the directory: /Users/bradley/Sites/clients/tmp This might take a couple of minutes.

✔ 1. Creating WPGulp files inside → tmp ⠴ 2. Installing npm packages.../Users/bradley/.npm/_npx/53976/lib/node_modules/wpgulp/installer/index.js:34 throw err; ^

Error: Command failed: npm install --silent

at makeError (/Users/bradley/.npm/_npx/53976/lib/node_modules/wpgulp/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/Users/bradley/.npm/_npx/53976/lib/node_modules/wpgulp/node_modules/execa/index.js:278:16)
at process._tickCallback (internal/process/next_tick.js:68:7)

running npm install --silent wpgulp: + wpgulp@2.6.0 added 143 packages from 70 contributors and audited 280 packages in 3.224s found 0 vulnerabilities

parys-github commented 5 years ago

Hi guys. I have exactly the same problem. After running: npx wpgulp it receives a message:

  1. Installing npm packages.../Users/me/.npm/_npx/23630/lib/node_modules/wpgulp/installer/index.js:34 throw err; ^

Error: Command failed: npm install --silent

at makeError (/Users/me/.npm/_npx/23630/lib/node_modules/wpgulp/node_modules/execa/index.js:174:9 at Promise.all.then.arr (/Users/me/.npm/_npx/23630/lib/node_modules/wpgulp/node_modules/execa/index.js:278:16) at process._tickCallback (internal/process/next_tick.js:68:7)

NPM: 6.4.1 NODE: v10.12.0 MAC OSX: 10.13.6

Trying to use solutions suggested above but no positive results unfortunately :-/

ahmadawais commented 5 years ago

Several folks were having same issues on Windows — some folks reported updating npm to the latest version fixed it. npm install --silent is failing for some reason.

Nervez commented 5 years ago

Several folks were having same issues on Windows — some folks reported updating npm to the latest version fixed it. npm install --silent is failing for some reason.

I'm on windows as well, having the same issue, even after updating npm to the latest version (6.4.1.)

ERROR -----------------------------------------------------------------------------------------------------

/ 2. Installing npm packages...C:\Users\me\AppData\Roaming\npm-cache_npx\14280\node_modules\wpgulp\installer\index.js:34 throw err; ^

Error: Command failed: npm install --silent

at makeError (C:\Users\me\AppData\Roaming\npm-cache\_npx\14280\node_modules\wpgulp\node_modules\execa\index.js:174:9)
at Promise.all.then.arr (C:\Users\me\AppData\Roaming\npm-cache\_npx\14280\node_modules\wpgulp\node_modules\execa\index.js:278:16)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7) 
lushkant commented 5 years ago

Having the same problem as the guys above on Windows 10. Tried both node 8 and 10 but it didn't make any difference. I did follow up with the conversation here but doing so didn't help! :(

gamanox commented 5 years ago

damn, it's there any workaround? thanks a lot, I tried everything in this conversation

berlindave commented 5 years ago

Same Problem here: With npx install I get:

2. Installing npm packages.../Users/dave/.npm/_npx/9692/lib/node_modules/wpgulp/installer/index.js:34
    throw err;
    ^

Error: Command failed: npm install --silent

    at makeError (/Users/dave/.npm/_npx/9692/lib/node_modules/wpgulp/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/Users/dave/.npm/_npx/9692/lib/node_modules/wpgulp/node_modules/execa/index.js:278:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)

npm install --silent is working.

With npx wpgulp@2.6.1-beta.0 I get:

2. Installing npm packages.../Users/dave/.npm/_npx/9764/lib/node_modules/wpgulp/installer/index.js:34
    throw err;
    ^

Error: Command failed: npm install
npm WARN deprecated gulp-util@2.2.20: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm ERR! code 1
npm ERR! Command failed: /usr/local/bin/git checkout 4.0
npm ERR! error: pathspec '4.0' did not match any file(s) known to git.
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dave/.npm/_logs/2018-10-23T17_19_51_195Z-debug.log

    at makeError (/Users/dave/.npm/_npx/9764/lib/node_modules/wpgulp/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/Users/dave/.npm/_npx/9764/lib/node_modules/wpgulp/node_modules/execa/index.js:278:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)

NPM: 6.4.1 NODE: v10.12.0 MAC OSX: 10.11.6

Any suggestions?

tarfoot commented 5 years ago

I think this is solved if you change the reference to gulp in package.json. It solved it for me anyhow. It does involve running npm install after npx wpgulp fails.

See issue #128 and the fix in #129

ahmadawais commented 5 years ago

Sorry, folks! I have been super busy. Looks like the latest npm had issues with gulp and now the recommended way to use gulp 4.0 is to write just that. Thanks @tarfoot for the PR #129 this should now be fixed.

elliottmangham commented 2 years ago

Hello, I seem to be having this issue (https://github.com/ahmadawais/WPGulp/issues/207).

I tried running npx wpgulp and then after it fails, running npm install, but this also errors.

Would really love any help, thank you

elliottmangham commented 2 years ago

Here's a screen of running npm install after npx wpgulp, where you can see it failing: image

Would be happy to pay for support on this, as I'd love to get WPGulp working - assuming it is still maintained anyway.

Thanks!

ahmadawais commented 2 years ago

Honestly, I haven't had much time lately to support this project for free. Will see if I can set some time aside if I get some support — with everything going on atm. Thank you! 🙌

elliottmangham commented 2 years ago

Thanks so much @ahmadawais, it's appreciated greatly. And as I said, I'm happy to pay for the Paddle contribution.

elliottmangham commented 2 years ago

Hey, so I decided to buy a brand-new Mac and attempt to get WPGulp running, since I had issues on my Windows machine. Unfortunately, I seem to have similar issues on this also (MacBook Pro 2021 model with M1 Pro chip) as well.

Below is my error log after running npx wpgulp: log.txt

Would love some help and insight, thank you.

ahmadawais commented 2 years ago

@ahmadbilaldev an excellent opportunity to contribute.