Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Node.js 10 and above (Update node-sass and lint-staged) #27

Merged
merged 3 commits into from
Sep 20, 2020

Conversation

nekonenene
Copy link

@nekonenene nekonenene commented Sep 19, 2020

Proposed changes

npm install succeeds with Node.js 8.x. But, its support has already ended.

This PR allows npm install with Node.js 10.x, 12.x, and 14.x.

Why update node-sass?

Please see, https://www.npmjs.com/package/node-sass

Supported Node.js versions vary by release

We are using node-sass v4.7.2, so the following error appears when npm install with Node.js 10 and above.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Why update lint-staged?

lint-staged says "lint-staged requires at least version 6 of Node, please upgrade" and we cannot commit while using Node.js 10 and above. This is a bug and it fixed on v7.0.5. ( lint-staged/lint-staged#434 )

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to change).

Checklist:

I checked passing npm install with Node.js v10.22.1, v12.18.4, and v14.11.0 using Docker.
(The error causing from node-gyp still appears, but it's ok. node-gyp is a dependency of iltorb and iltorb is an optionalDependencies of grunt-contrib-compress.)

After that, I tried npm run dev, npm run test, npx grunt release --oldver=1.0.0 --newver=1.0.1, and these work well.

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Smankusors Smankusors requested a review from a team September 20, 2020 04:35
@DanielRuf
Copy link

Awesome =)
So the generated code still works?

Can you drop / remove the lockfile changes from this PR? Because npm will use the versions from your package.json and this should prevent merge conflicts when I update the lockfile on the target branch.

@nekonenene
Copy link
Author

nekonenene commented Sep 20, 2020

@DanielRuf

So the generated code still works?

Yes, as far as I can see, it seems generate same http://localhost:8000.

Can you drop / remove the lockfile changes from this PR?

I can, but I wonder when you will update lockfile. It's not a good idea to prevent updating package-lock.json because it will cause differences in the environment between developers.

@DanielRuf
Copy link

Lockfiles are not used by consumer (npm users) who install from npmjs.

The lockfile is just for CI.

After a PR is merged I update the lockfile. And it is mainly used by npm ci.

@nekonenene
Copy link
Author

@DanielRuf OK!

npm ERR! Invalid: lock file's [email protected] does not satisfy lint-staged@^7.0.5
npm ERR! Invalid: lock file's [email protected] does not satisfy node-sass@^4.14.1

https://travis-ci.com/github/materializecss/materialize/builds/185432205

Oh...what should i do now...

@DanielRuf
Copy link

Everything is ok. This is expected because we use npm ci.

@DanielRuf DanielRuf merged commit a034ec1 into materializecss:v1-dev Sep 20, 2020
@Smankusors Smankusors added the meta Issues with the project itself or our GitHub repository. label Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Issues with the project itself or our GitHub repository.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants