p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Contributor Docs - Development Process - out of date?

Open ffd8 opened this issue 2 years ago • 5 comments

Topic

Just setting up a new machine (M1 MBP) and trying to get setup again for compiling p5.js – did an upstream grab for my local repo, switched to a new branch based on 'main' – trying to follow the Development Process of the contributor docs – but running into an issue at step 5 using Grunt. Ran npm ci (which has the warning of an old lock file..).. I do get one error at the end of the install:

npm WARN deprecated [email protected]: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm ERR! Invalid Version: 0.4.0rc7

Checking the error log, see the following at the bottom, while installing grunt which is the issue i have on step 5.. saying it doesn't exist (checked node_modules and theres 'grunt', 'grunt-cli' and 16 other grunt folders for contrib/lint/etc:

5012 timing metavuln:packument:grunt-contrib-yuidoc Completed in 1ms
5013 timing metavuln:cache:get:security-advisory:grunt-contrib-yuidoc:3KrIIePvZ30ZdDn34gi5hIP8KLRhqmJa80s1Dsm/Ixbxh9G0b0fhl8ohpS3YhVrLmsHp/+IZ5XQlKhesC9j4aA== Completed in 2ms
5014 verbose stack TypeError: Invalid Version: 0.4.0rc7
5014 verbose stack     at new SemVer (/usr/local/lib/node_modules/npm/node_modules/semver/classes/semver.js:38:13)
5014 verbose stack     at compareBuild (/usr/local/lib/node_modules/npm/node_modules/semver/functions/compare-build.js:3:20)
5014 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/semver/functions/sort.js:2:51
5014 verbose stack     at Array.sort (<anonymous>)
5014 verbose stack     at Object.sort (/usr/local/lib/node_modules/npm/node_modules/semver/functions/sort.js:2:36)
5014 verbose stack     at Advisory.[calculateRange] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js:159:28)
5014 verbose stack     at Advisory.load (/usr/local/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js:148:28)
5014 verbose stack     at Calculator.[calculate] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js:59:14)
5014 verbose stack     at async Promise.all (index 0)
5014 verbose stack     at async Map.[init] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:192:7)
5015 verbose cwd /Users/_CENSORED_/Documents/_CENSORED_/interaction/p5js/p5.js
5016 verbose Darwin 21.4.0
5017 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "ci"
5018 verbose node v16.13.2
5019 verbose npm  v8.1.2
5020 error Invalid Version: 0.4.0rc7
5021 verbose exit 1

I'm guessing this means it failed to install grunt.. because when trying to do either command as step 5: npm run grunt or npm run dev, both return with the error:

[email protected] grunt
> grunt

sh: grunt: command not found

No idea if this is a bug or an issue with my setup M1 MBP, MacOS Monterey (12.3.1), node v16.13.2, npm v8.1.2 – or I'm making some n00b mistake...

@limzykenneth perhaps you have an overview of the contributor docs or know if the workflow has changed since it was last edited? Thanks in advance for any tips you might have.

ffd8 avatar Jun 08 '22 20:06 ffd8

There seems to be something going on on NPM side about this: https://github.com/npm/cli/issues/4992

I'm looking into a workaround for us.

Edit: A quick workaround for now is to use node v14 with npm v6 which I have tested to be working. It seems to be a npm v8 problem overall.

Edit 2: Maximum working npm version is 7.4.1

limzykenneth avatar Jun 11 '22 12:06 limzykenneth

Thanks for looking into this and relieving to learn that it's a general issue and not just on my end. Will consider downgrading and see how it works, since seems v16+ is intended for apple silicon.

ffd8 avatar Jun 11 '22 22:06 ffd8

We should update the docs and specify valid versions for node, as the build fails with the current LTS version (16.x) and the instructions here (though my error is a bit different than @ffd8's). Perhaps lts/fermium makes sense for now...

image

dhowe avatar Sep 04 '22 07:09 dhowe

Perhaps this should be a separate issue but I also get a failing test when trying to build the current source

(moved to new issue)

dhowe avatar Sep 04 '22 07:09 dhowe

We should update the docs and specify valid versions for node, as the build fails with the current LTS version (16.x) and the instructions here (though my error is a bit different than @ffd8's). Perhaps lts/fermium makes sense for now...

Judging on the activity (or lack thereof) on the issue linked on npm it doesn't seem likely this will be fixed any time soon if ever. I'm currently working on the contributor docs and will likely include this info there but for longer term we probably need alternative documentation solution.

~> Perhaps this should be a separate issue but I also get a failing test when trying to build the current source:~

~Probably better as a separate issue, could be a performance or bottle neck problem.~

limzykenneth avatar Sep 04 '22 10:09 limzykenneth

Good news! NPM seems to have finally resolved this bug and I have tested at least npm 8.19.3 which comes with default install of node 18.13.0. I don't know what the minimum working version of node is to get the fix but for now the recommendation is to work with p5.js with node 18.

I'll close this issue now.

limzykenneth avatar Jan 08 '23 15:01 limzykenneth