understrap / understrap

Underscores + Bootstrap = Understrap, the renowned open-source WordPress starter theme.
https://understrap.com
GNU General Public License v3.0
3.04k stars 959 forks source link

Cant install or update via npm #978

Closed felix-berlin closed 5 years ago

felix-berlin commented 5 years ago

Issue is about..

Please tell us about your environment:


I tryed to install understrap via npm and i got this output.

Console Output

PS D:\under> npm install understrap

node-sass@4.12.0 install D:\under\node_modules\node-sass node scripts/install.js

Cached binary found at C:\Users\XXX\AppData\Roaming\npm-cache\node-sass\4.12.0\win32-x64-64_binding.node

node-sass@4.12.0 postinstall D:\under\node_modules\node-sass node scripts/build.js

Binary found at D:\under\node_modules\node-sass\vendor\win32-x64-64\binding.node Testing binary Binary is fine

gifsicle@4.0.1 postinstall D:\under\node_modules\gifsicle node lib/install.js

√ gifsicle pre-build test passed successfully

jpegtran-bin@4.0.0 postinstall D:\under\node_modules\jpegtran-bin node lib/install.js

√ jpegtran pre-build test passed successfully

optipng-bin@5.1.0 postinstall D:\under\node_modules\optipng-bin node lib/install.js

√ optipng pre-build test passed successfully

understrap@0.9.3 postinstall D:\under\node_modules\understrap gulp copy-assets

internal/modules/cjs/loader.js:582 throw err; ^

Error: Cannot find module 'gulp-babel' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15) at Function.Module._load (internal/modules/cjs/loader.js:506:25) at Module.require (internal/modules/cjs/loader.js:636:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (D:\under\node_modules\understrap\gulpfile.js:5:13) at Module._compile (internal/modules/cjs/loader.js:688:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) npm WARN enoent ENOENT: no such file or directory, open 'D:\under\package.json' npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself. npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself. npm WARN under No description npm WARN under No repository field. npm WARN under No README data npm WARN under No license field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! understrap@0.9.3 postinstall: gulp copy-assets npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the understrap@0.9.3 postinstall 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! C:\Users\XXX\AppData\Roaming\npm-cache_logs\2019-05-21T08_43_18_587Z-debug.log

SvenGeorge commented 5 years ago

same here

SvenGeorge commented 5 years ago

Even if I run npm install --save-dev understrap (where the missing gulp deps are defined, i'll get an unhandled error.

`> gulp copy-assets

[15:54:55] Using gulpfile ~\test\test\node_modules\understrap\gulpfile.js [15:54:55] Starting 'copy-assets'... [15:54:55] Finished 'copy-assets' after 24 ms events.js:174 throw er; // Unhandled 'error' event ^

Error: File not found with singular glob: XXX/test/test/node_modules/understrap/node_modules/undescores-for-npm/js/skip-link-focus-fix.js (if this was purposeful, use allowEmpty option) at Glob. (XXX\test\test\node_modules\glob-stream\readable.js:84:17) at Object.onceWrapper (events.js:277:13) at Glob.emit (events.js:189:13) at Glob.EventEmitter.emit (domain.js:441:20) at Glob._finish (XXX\test\test\node_modules\glob\glob.js:197:8) at done (XXX\test\test\node_modules\glob\glob.js:182:14) at Glob._processSimple2 (XXX\test\test\node_modules\glob\glob.js:688:12) at XXX\test\test\node_modules\glob\glob.js:676:10 at Glob._stat2 (XXX\test\test\nodemodules\glob\glob.js:772:12) at lstatcb (XXX\test\test\node_modules\glob\glob.js:764:12) Emitted 'error' event at: at DestroyableTransform.EventEmitter.emit (domain.js:454:12) at Pumpify.emit (events.js:189:13) at Pumpify.EventEmitter.emit (domain.js:441:20) at Pumpify.Duplexify._destroy (XXX\test\test\node_modules\duplexify\index.js:191:15) at XXX\test\test\node_modules\duplexify\index.js:182:10 at process._tickCallback (internal/process/next_tick.js:61:11)

ericlammel commented 5 years ago

I believe this error occurs because npm have some issues when it is downloading dependencies. Delete the /node_modules directory and reinstall all dependencies again with npm install.

jamiedoherty commented 5 years ago

@ericlammel no such luck. This happens on a brand new fresh install in an empty directory.

0dp commented 5 years ago

Instead of trying to install the theme with npm. Have you tried downloading the latest version of understrap into your themes folder and execute npm install from within the understrap theme folder?

Per say, you can't really install understrap with npm install understrap even if its mentioned in the documentation.

980

felix-berlin commented 5 years ago

@0dp when i download the last release and execute npm install it worked.

But npm install understrap in a brand new folder still does not work. The same by npm update in an existing project.

extamus commented 5 years ago

Here to echo the same issues. I'm on a mac, and even a fresh install isn't functioning correctly with 0.9.3. I don't try to install with NPM; I install the theme in the WordPress theme folder, then run npm install and get a series of errors.

0dp commented 5 years ago

@extamus, that sounds like a completely different issue. Please open a new issue and provide your own report.

@felix-berlin As I said, npm is not supposed to work like that. Npm is for dependency management, not theme installation or update.

jamiedoherty commented 5 years ago

@0dp I'm using the Understrap child theme and ideally would like to set the parent theme as a dependency on initial install. npm install understrap works for version 0.9.1. If there is no plan to continue to support this, the documentation should be updated.

0dp commented 5 years ago

Ok I can clearly see there is a problem.

I will investigate.

0dp commented 5 years ago

Installing a package with npm, adds it as a project dependency. That means it will ignore the devDependencies listed in the package package.json Since the devDependencies are needed to run the gulp tasks, it all fails.

A quick fix would be to move all the devDependiences up into the package.json dependencies.

I'm using the Understrap child theme and ideally would like to set the parent theme as a dependency on initial install.

This happens by default, but the child-theme is not up to date with the new gulp4 setup, so you will probably have to install the missing parent themes dev dependencies manually before executing npm install. Just as a temporary fix

For now my recommendation is to download the themes manually and execute npm install from within the directory.

@understrap/child-theme-team @understrap/accessibility-quality @KenEucker

Thomas-A-Reinert commented 5 years ago

I agree to @0dp - understrap at it´s current status is NOT meant to be INSTALLED via NPM. I cannot even say if it´s packages are currently updated - but it seems as if not. We´ll dig into that as soon as some other things are ironed out.

Even if I´m not personally "responsible" for the issues involved, I really feel sorry for any inconveniences and totally understand you, the community, worrying.

I can´t even say why the npm package is still getting released. We´ll iron out that issue too.

The recommended way using understrap at the current time is to download or clone the repo, rename it to understrap instead of understrap-master and do an npm install in that dir. I know - and feel sorry about it! - that the docs actually suck a lot and do not reflect the current state. We´re working on that.

Cannot / will not say more about that, but hopefully things are going to change soon. :)

Sidenote: Alle deutschen Anwender können mich auch gerne direkt kontaktieren. Ich versuche gerne, zeitnah weiter zu helfen.

axlright commented 5 years ago

I'm not a npm ninja but I can say I do not start new projects from npm. I essentially go the route of cloning the parent and child themes.

What my team actually does is have an install on a WP Engine server that I keep up-to-date along with a bunch of starter customizations and starter plugins and Advanced Custom Fields starter setups and Custom Post Types and whatnot, then I clone this into a new WP Engine install, further customize per the client's needs then export the whole thing - code and database - to my local environment and all my developers' local environments then we all run npm install locally, ignore node_modules and push back to a new common GitHub repo. Works like a charm.

This is a long winded way of saying I don't use or have much knowledge of installing parent and child themes via npm, and I see a much better route of cloning actual WordPress installs as it makes it possible to start off with both an updated set of parent and child themes and common plugins and other setups.

axlright commented 5 years ago

I'm getting a similar issue related to Cannot find module 'gulp-babel' when updating an existing project.

I've updated the parent understrap to 0.9.3 and am in the process of updating the child to 0.5.5 and I get

> understrap@0.9.3 postinstall /Users/alexwright/Sites/XXX/web/wp-content/themes/XXX/node_modules/understrap
> gulp copy-assets

internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module 'gulp-babel'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/Users/alexwright/Sites/sneed-vine/web/wp-content/themes/sneed-vine/node_modules/understrap/gulpfile.js:5:13)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! understrap@0.9.3 postinstall: `gulp copy-assets`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the understrap@0.9.3 postinstall 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/alexwright/.npm/_logs/2019-06-14T19_39_52_311Z-debug.log

node_modules doesn't have an understrap directory

If I change the dependencies in the child theme package.json from "understrap": "^0.9.1", to "understrap": "0.9.1", it works fine and the understrap directory loads in the node_modeles directory. but "understrap": "^0.9.1", and "understrap": "0.9.2", and "understrap": "0.9.3", don't work.

0dp commented 5 years ago

@axlright You can always fix it by manually installing the missing deps.

But I would say the best fix would be to remove the understrap npm dependency all together from the project. I don't see the meaning of having itself as a dependency.

Instead we could consider introducing the npm version as a npx package. That would make sense to me

Thomas-A-Reinert commented 5 years ago

@0dp , @axlright , @holger1411 - you´re keeping this issue on your radar?!

I´m going to close this issue, because due to https://github.com/understrap/understrap/issues/978#issuecomment-496989264 it has - kinda - been resolved.

shikkaba commented 4 years ago

@Thomas-A-Reinert Not really sure why this is closed if it isn't fixed. This still happens. Just had it happen now. Manually installing the files isn't the same as using npm, even if it does the same thing pretty much. If that is considered a fix, then the npm installation should be removed from the docs as having it there makes people assume that this works.

IanDelMar commented 4 years ago

@shikkaba which version of UnderStrap are you using?

shikkaba commented 4 years ago

@IanDelMar npm install understrap uses 0.9.3 still from the looks of it.

Using the manual files worked fine, but trying to use npm to get the files throws similar error to what the original poster had, hence not opening a new issue.

Error: Cannot find module 'gulp-babel'
Require stack:
- /Users/lisacerilli/node_modules/understrap/gulpfile.js
- /Users/lisacerilli/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js
- /Users/lisacerilli/node_modules/gulp/node_modules/gulp-cli/index.js
- /Users/lisacerilli/node_modules/gulp/bin/gulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:952:15)
    at Function.Module._load (internal/modules/cjs/loader.js:835:27)
    at Module.require (internal/modules/cjs/loader.js:1012:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/lisacerilli/node_modules/understrap/gulpfile.js:5:13)
    at Module._compile (internal/modules/cjs/loader.js:1123:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:972:32)
    at Function.Module._load (internal/modules/cjs/loader.js:872:14)
    at Module.require (internal/modules/cjs/loader.js:1012:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/lisacerilli/node_modules/understrap/gulpfile.js',
    '/Users/lisacerilli/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js',
    '/Users/lisacerilli/node_modules/gulp/node_modules/gulp-cli/index.js',
    '/Users/lisacerilli/node_modules/gulp/bin/gulp.js'
  ]
}
npm WARN enoent ENOENT: no such file or directory, open '/Users/lisacerilli/package.json'
npm WARN bootstrap@4.4.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.4.1 requires a peer of popper.js@^1.16.0 but none is installed. You must install peer dependencies yourself.
npm WARN lisacerilli No description
npm WARN lisacerilli No repository field.
npm WARN lisacerilli No README data
npm WARN lisacerilli No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! understrap@0.9.3 postinstall: 'gulp copy-assets'
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the understrap@0.9.3 postinstall 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/lisacerilli/.npm/_logs/2020-05-05T18_08_26_277Z-debug.log
felix-berlin commented 4 years ago

Hey @shikkaba since this problem i am using understrap 0.9.1. This works fine for me.

shikkaba commented 4 years ago

@felix-berlin how do you install the newest version with npm install understrap? It's not in the documentation. Installing manually is fine, but that wasn't your original issue. The issue you had before was with installing directly through npm.

felix-berlin commented 4 years ago

I dont use the newest version. My original problem was to update the parent theme.

Iam using the understrap child theme and the understrap parent theme as dependency. In my packages.json i wrote "understrap": "0.9.1".

shikkaba commented 4 years ago

@felix-berlin Ah, but I'm referring to what you had originally pointed out in this comment as this is what I tried, and that it still doesn't work but is in the documentation as an installation option.

yushanwebdev commented 3 years ago

@felix-berlin still getting an error like this even I wrote "understrap": "0.9.1"

`npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 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 WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x. npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

understrap@0.9.1 postinstall C:\xampp\htdocs\lymited\lym\wp\wp-content\themes\lymited-child\node_modules\understrap gulp copy-assets

fs.js:36 } = primordials; ^

ReferenceError: primordials is not defined at fs.js:36:5 at req_ (C:\xampp\htdocs\lymited\lym\wp\wp-content\themes\lymited-child\node_modules\natives\index.js:143:24) at Object.req [as require] (C:\xampp\htdocs\lymited\lym\wp\wp-content\themes\lymited-child\node_modules\natives\index.js:55:10) at Object. (C:\xampp\htdocs\lymited\lym\wp\wp-content\themes\lymited-child\node_modules\understrap\node_modules\graceful-fs\fs.js:1:37) at Module._compile (internal/modules/cjs/loader.js:1015:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10) at Module.load (internal/modules/cjs/loader.js:879:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Module.require (internal/modules/cjs/loader.js:903:19) at require (internal/modules/cjs/helpers.js:74:18) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\glob-watcher\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\gulp-watch\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! understrap@0.9.1 postinstall: gulp copy-assets npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the understrap@0.9.1 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

felix-berlin commented 3 years ago

@yushanwebdev witch node js version do you use?