[wp-trac] [WordPress Trac] #35105: Specifiy minimum node and npm version in package.json
WordPress Trac
noreply at wordpress.org
Tue Dec 15 22:59:27 UTC 2015
#35105: Specifiy minimum node and npm version in package.json
------------------------------+------------------
Reporter: jorbin | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.5
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
------------------------------+------------------
Comment (by netweb):
My notes from [ticket:30787#comment:9 #30787] ( Shrinkwrap NPM
dependencies):
> Also we should be using at least NodeJS v0.12.x as PostCSS requires this
v0.12.x or greater, and WordPress includes two node modules that use
PostCSS, Autoprefixer and RTLCSS.
>
> I'd be tempted to actually recommend that we bump up our minimum
supported NodeJS version to v4.x LTS per the
[https://nodejs.org/en/blog/community/node-v5/ LTS announcment], this
brings back compatibility of IO.JS and NodeJS branches and gives us a
somewhat more dependable NodeJS base that module owners are aware of for
maintaining backcompat for this NodeJS version.
I just hit upon the NodeJS LTS document:
https://github.com/nodejs/LTS/blob/master/README.md which details the LTS
plan and roadmap which clears things up a bit on whats whats in regard to
the timelines of NodeJS versions
----
Grepping the `/node_modules` folder shows the vast majority of packages
require NodeJS `>=0.10`, and 4 require `>=0.12`
* PostCSS requires NodeJS `>=0.12` so that includes `autoprefixer`,
`grunt-rtlcss`, and `grunt-postcss`.
* `get-stdin` is a dependant in the `grunt-contrib-imagemin` tree and also
requires NodeJS `>=0.12`
None required NodeJS v4.x or greater so we can use NodeJS `>=0.12` for
now, and switch to v4.x LTS once that need arises.
----
Complimentary to this ticket could be to add
[https://www.npmjs.com/package/grunt-check-dependencies grunt-check-
dependencies] via [https://www.npmjs.com/package/check-dependencies check-
dependencies]:
> ''The checkDependencies task checks if the package has all necessary
dependencies installed in right versions. If that's not the case, the task
fails and advises to run npm install.''
It was added to BuddyPress in [buddypress:changeset:10399] and the Grunt
task is run before any other Grunt tasks, if it fails your prompted with
the advisory to run `npm install`, works quite well and takes some of the
pain out of working out maintaining your npm workflow.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35105#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list