JeremyEnglert / JointsWP

A blank WordPress theme built with Foundation 6, giving you all the power and flexibility you need to build complex, mobile friendly websites without having to start from scratch.
http://jointswp.com
851 stars 272 forks source link

NPM Install Failing #369

Closed tonyhardy closed 6 years ago

tonyhardy commented 6 years ago

Hi Jeremy/Joints team,

I've been using Joints for several years now without issue. Suddenly on npm install, Terminal throws back:

npm ERR! code 1 npm ERR! Command failed: /usr/bin/git checkout 4.0 npm ERR! error: pathspec '4.0' did not match any file(s) known to git.

Any idea what that's all about?

JeremyEnglert commented 6 years ago

That's odd. What version of Node and NPM are you running?

tonyhardy commented 6 years ago

Running Node v8.12.0 Running NPM v6.4.1

It is odd. It’s been working since forever, and now - nothing.

Tony Hardy thardy@canny-creative.com www.canny-creative.com 0191 364 3030

On 21 Oct 2018, at 19:11, Jeremy Englert notifications@github.com wrote:

That's odd. What version of Node and NPM are you running?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JeremyEnglert/JointsWP/issues/369#issuecomment-431712559, or mute the thread https://github.com/notifications/unsubscribe-auth/AqRlkbPI-rF6KbszzjCdZlBQHOgwq8slks5unP8xgaJpZM4XyJpM.

girlandboystudio commented 6 years ago

I am experiencing the exact same issue, suddenly on a new project, npm install fails with the same error messages as highlighted above?

timothabgreen commented 6 years ago

I have the same issue too. Here is my log.

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install', 'gulp' ] 2 info using npm@6.0.0 3 info using node@v8.10.0 4 verbose npm-session 8ed218001ee64539 5 silly install loadCurrentTree 6 silly install readLocalPackageData 7 silly fetchPackageMetaData error for gulp@github:gulpjs/gulp#4.0 Command failed: /usr/bin/git checkout 4.0 7 silly fetchPackageMetaData error: pathspec '4.0' did not match any file(s) known to git. 8 timing stage:rollbackFailedOptional Completed in 0ms 9 timing stage:runTopLevelLifecycles Completed in 2442ms 10 verbose stack Error: Command failed: /usr/bin/git checkout 4.0 10 verbose stack error: pathspec '4.0' did not match any file(s) known to git. 10 verbose stack 10 verbose stack at ChildProcess.exithandler (child_process.js:275:12) 10 verbose stack at emitTwo (events.js:126:13) 10 verbose stack at ChildProcess.emit (events.js:214:7) 10 verbose stack at maybeClose (internal/child_process.js:925:16) 10 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 11 verbose cwd /Users/XXXXXXXXX/Documents/Sites/XXXXX/wp-content/themes/JointsWP 12 verbose Darwin 17.6.0 13 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "gulp" 14 verbose node v8.10.0 15 verbose npm v6.0.0 16 error code 1 17 error Command failed: /usr/bin/git checkout 4.0 17 error error: pathspec '4.0' did not match any file(s) known to git. 18 verbose exit [ 1, true ]

amdd-tim commented 6 years ago

Same issue here.

fwiw, I change the package.json gulp dependency line to "gulp": "^4.0", and got npm install to run successfully. But I'll also admit I don't know enough about npm to confirm that that's a good, long term solution.

tonyhardy commented 6 years ago

I've just tried that @amdd-tim - and it appears to have worked too.

However, just like you mentioned, I also don't know enough about npm to confirm whether or not that's the long term fix.

garretthyder commented 6 years ago

Hello,

Looking into this the package.json was pulling gulp 4.0 from github but it appears when they released v4.0.0 on github they changed the tag from 4.0 to v4.0.0.

Changing to ^4.0 isn't valid here as the latest available via npm is 3.9.1; https://www.npmjs.com/package/gulp *The reason why this works is if your number is higher than the available it'll just fall back so you're using 3.9.1 and not 4.0

So to get the latest off github we just have to switch to using the v4.0.0 tag like so; "gulp": "github:gulpjs/gulp#v4.0.0",

I pushed a fix to this. Cheers

brandonwittwer commented 5 years ago

FWIW, NPM has gulp updated to 4.0.0. so "gulp":"^4.0.0" away boys and girls!

catchlightWeb commented 5 years ago

Hi Jeremy, I'm also experiencing this exact issue. Is this now fixed? What's the best way to get the fix? Delete node_modules and re-install?

garretthyder commented 5 years ago

Hi @catchlightWeb

This fix was merged so if you have the latest package.json then yes removing and re-installing is the way to go; rm -rf node_modules npm install

If that's not working make sure that inside your package.json the gulp package is defined as follows; "gulp": "github:gulpjs/gulp#v4.0.0", *Make sure the version is v4.0.0, if it's just 4.0 then that's incorrect.

Hope that helps.

meiskv commented 5 years ago

Hi @catchlightWeb

This fix was merged so if you have the latest package.json then yes removing and re-installing is the way to go; rm -rf node_modules npm install

If that's not working make sure that inside your package.json the gulp package is defined as follows; "gulp": "github:gulpjs/gulp#v4.0.0", *Make sure the version is v4.0.0, if it's just 4.0 then that's incorrect.

Hope that helps.

I did exactly what you said but unfortunately it still not working.

meiskv commented 5 years ago

It got stack on this line "⸨ ░░░░░░░░░░░░░░░░░⸩ ⠸ loadIdealTree:loadAllDepsIntoIdealTree: sill install loadIdealTree"

Then throw this error "npm ERR! code 128 npm ERR! Command failed: /usr/bin/git checkout 71c094a51c7972d26f557899ddecab0210ef3776 npm ERR! fatal: reference is not a tree: 71c094a51c7972d26f557899ddecab0210ef3776"

and this is the log error.

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install' ] 2 info using npm@5.5.1 3 info using node@v8.9.3 4 verbose npm-session f36d59a2abe0e27a 5 silly install runPreinstallTopLevelLifecycles 6 silly preinstall jointswp-sass@5.0.0 7 info lifecycle jointswp-sass@5.0.0~preinstall: jointswp-sass@5.0.0 8 silly install loadCurrentTree 9 silly install readLocalPackageData 10 silly install loadIdealTree 11 silly install cloneCurrentTreeToIdealTree 12 silly install loadShrinkwrap 13 silly fetchPackageMetaData error for gulp@github:gulpjs/gulp#71c094a51c7972d26f557899ddecab0210ef3776 Command failed: /usr/bin/git checkout 71c094a51c7972d26f557899ddecab0210ef3776 13 silly fetchPackageMetaData fatal: reference is not a tree: 71c094a51c7972d26f557899ddecab0210ef3776 14 verbose stack Error: Command failed: /usr/bin/git checkout 71c094a51c7972d26f557899ddecab0210ef3776 14 verbose stack fatal: reference is not a tree: 71c094a51c7972d26f557899ddecab0210ef3776 14 verbose stack 14 verbose stack at ChildProcess.exithandler (child_process.js:275:12) 14 verbose stack at emitTwo (events.js:126:13) 14 verbose stack at ChildProcess.emit (events.js:214:7) 14 verbose stack at maybeClose (internal/child_process.js:925:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 15 verbose cwd /Applications/MAMP/htdocs/DEV/gcreative/wp-content/themes/m_gcreativelab 16 verbose Darwin 16.7.0 17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" 18 verbose node v8.9.3 19 verbose npm v5.5.1 20 error code 128 21 error Command failed: /usr/bin/git checkout 71c094a51c7972d26f557899ddecab0210ef3776 21 error fatal: reference is not a tree: 71c094a51c7972d26f557899ddecab0210ef3776 22 verbose exit [ 1, true ]

meiskv commented 5 years ago

I'm receiving a new error.

npm ERR! code 1 npm ERR! Command failed: /usr/bin/git checkout 4.0 npm ERR! error: pathspec '4.0' did not match any file(s) known to git.

garretthyder commented 5 years ago

Hi @meiskv can you gist me your package.json and I'll take a look.

From your error message it doesn't look like the gulp line was updated or maybe there's a second occurrence of it.

It could also be an order of operations as they'll need to be done as follows;

All the best

meiskv commented 5 years ago

{ "name": "jointswp-sass", "version": "5.0.0", "description": "A WordPress starter theme using Foundation 6", "repository": { "type": "git", "url": "https://github.com/JeremyEnglert/JointsWP.git" }, "author": "Jeremy Englert", "license": "GPL-2.0 AND MIT", "homepage": "https://github.com/JeremyEnglert/JointsWP", "devDependencies": { "babel-preset-es2015": "^6.5.0", "barba.js": "^1.0.0", "browser-sync": "^2.11.0", "foundation-sites": "6.4.3", "gulp": "github:gulpjs/gulp#v4.0.0", "gulp-autoprefixer": "^2.3.1", "gulp-babel": "^6.1.2", "gulp-concat": "^2.5.2", "gulp-cssnano": "^2.1.1", "gulp-filter": "^5.0.0", "gulp-imagemin": "^3.1.1", "gulp-jshint": "^1.11.0", "gulp-load-plugins": "^1.4.0", "gulp-newer": "^1.3.0", "gulp-plumber": "^1.0.1", "gulp-sass": "^2.0.1", "gulp-sourcemaps": "^1.6.0", "gulp-uglify": "^1.2.0", "gulp-util": "^3.0.5", "gulp-wp-pot": "^2.0.4", "jshint-stylish": "^2.0.0", "motion-ui": "^1.2.2" }, "scripts": { "postinstall": "npm run build", "build": "gulp", "scripts": "gulp scripts", "styles": "gulp styles", "images": "gulp images", "watch": "gulp watch", "browsersync": "gulp browsersync", "update-foundation": "npm install foundation-sites" }, "jshintConfig": { "globals": { "jQuery": true } }, "dependencies": { "bodymovin": "^4.13.0", "gsap": "^2.0.1", "jquery-parallax.js": "^1.5.0", "lodash": "^4.17.10", "rellax": "^1.6.2", "scrollmagic": "^2.0.5", "slick-carousel": "^1.8.1", "swiper": "^4.3.3" } } Here is the screenshot of the error. https://pasteboard.co/I8nnS9S.png

garretthyder commented 5 years ago

Thanks @meiskv is this a fresh install or pre-existing? Can you try a fresh install to make sure it's just your specific repo that's of issue.

It's strange the package.json you sent looks right but the error is still that of when gulp was defined as 4.0.

In your order of operations there did you modify package.json before doing the removal and reinstall?

Another thought is the package-lock.json after updatign your package.json can you remove it, then remove node_modules and finally run npm install again?

Thank you

meiskv commented 5 years ago

It's a pre-existing.

I will try a fresh tomorrow as soon as I get on the office.

Yup, that I thought also.

I'm not sure if it matters. But as far as I can remember I modified the package.json before removing of the node_modules.

I have delete the package-lock.json and updated package.json and it didn't work also.

Many thanks @garrett-eclipse .