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

Min node version required is 6.3 #510

Closed
aandis opened this issue Jan 27, 2019 · 2 comments
Closed

Min node version required is 6.3 #510

aandis opened this issue Jan 27, 2019 · 2 comments

Comments

@aandis
Copy link
Contributor

aandis commented Jan 27, 2019

Reticketed from #457 (comment)

Expected Behavior

Login should work after upgrade if you logout and log back in.

Actual Behavior

$ clasp login
Warning: You seem to already be logged in *globally*. You have a ~/.clasprc.json

$ clasp logout
$ clasp login
Logging in globally...
Authorize clasp by visiting this url:
https://accounts.google.com/o/oauth2/v2/auth?...

Authorization successful.

/usr/local/lib/node_modules/@google/clasp/node_modules/dotf/index.js:39
          fs.chmodSync(fullpath, fs.constants.S_IRUSR | fs.constants.S_IWUSR);
                                             ^

TypeError: Cannot read property 'S_IRUSR' of undefined
    at jsonfile.writeFile (/usr/local/lib/node_modules/@google/clasp/node_modules/dotf/index.js:39:46)
    at /usr/local/lib/node_modules/@google/clasp/node_modules/graceful-fs/graceful-fs.js:111:16
    at /usr/local/lib/node_modules/@google/clasp/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqWrap.oncomplete (fs.js:117:15)

Steps to Reproduce the Problem

This only occurs on node <= 6.2.
On login, you see the above error.

Cause

On login, dotf tries to access fs.constants.S_IRUSR which is only available in 6.3 and above. Whereas README states min node version required as 6.0.0.

Possible fixes

  1. Bump the min version requirement in README.
  2. Directly specify the mode as an octal value 0o600 in dotf instead of relying on the constant. From docs

An easier method of constructing the mode is to use a sequence of three octal digits.

Specifications

  • Node version (node -v): 6.2.2
  • Version (clasp -v): 1.7.0
  • OS (Mac/Linux/Windows): Linux/Ubuntu 14.04.5 LTS
@grant
Copy link
Contributor

grant commented Jan 27, 2019

OK. Do you want to upgrade the guide to state 6.3 is required?

@aandis
Copy link
Contributor Author

aandis commented Jan 28, 2019

@grant #511

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants