Seravo / wordpress

The WordPress project layout used by many of Seravo's customers, suitable also for local development with Vagrant and git deployment
https://seravo.com
GNU General Public License v3.0
102 stars 54 forks source link

NodeJS upgrade issues, frequently with node-sass #128

Open ottok opened 4 years ago

ottok commented 4 years ago

Note directly related to our project template, but still a common issue worth documenting.

Many have reported problems with node-sass and the latest NodeJS version. Root cause and its solution seem to be https://github.com/dlmanning/gulp-sass/pull/748

Another issue seems to be stray caches. To ensure that npm or yarn installs the latest versions of everything, these tips might help:

rm -rf node_modules .cache-loader package-lock.json yarn.lock
npm cache clean -f
npm install

These might also sometimes help:

npm --depth 9999 update
npm rebuild

Note, that you might also get different results with npm install X and yarn add X in some corner cases, even though they in principle obey the same package.json

ottok commented 4 years ago

Naturally, if the package.json is fixed to some very old NodeJS libraries that don't run on NodeJS 12, then those dependencies need to be bumped.

Kimitri commented 4 years ago

As the package.json file is provided in the repository (and rightfully so), would it make sense to include a .nvmrc file (or some equivalent) as well? That would make it easier to get to a known working state with the site and get people started building stuff faster.

ottok commented 4 years ago

@Kimitri Would you like to make a suggestion in the form of a pull request?

Kimitri commented 4 years ago

@ottok Sure! That would be nice. Do you guys have any contribution guidelines that I should check out first?

ottok commented 4 years ago

@ottok Sure! That would be nice. Do you guys have any contribution guidelines that I should check out first?

Nothing special. Just open a PR like on any other Github project. If the solution is not a piece of code/automation, you can also make a documentation PR agains https://github.com/Seravo/docs (that is https://seravo.com/docs/).

ottok commented 4 years ago

Related: Occasionally people reported issues with gulp-sass wanting to build, and that was because the version we used was so old that it wasn't available as a binary from upstream anymore. Fixed via https://github.com/Seravo/wordpress/pull/108