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

canvas-prebuilt is deprecated and can't use on newer node versions #2892

Closed
maya opened this issue Dec 18, 2018 · 8 comments
Closed

canvas-prebuilt is deprecated and can't use on newer node versions #2892

maya opened this issue Dec 18, 2018 · 8 comments

Comments

@maya
Copy link
Contributor

maya commented Dec 18, 2018

Error output

➜  uswds git:(release-2.0) npm install

> uswds@2.0.0-beta.4 prepare /Users/mayaben-ari/Code/web-design-standards
> gulp build

fs.js:25
'use strict';
^

ReferenceError: internalBinding is not defined
    at fs.js:25:1
    at req_ (/Users/mayaben-ari/Code/web-design-standards/node_modules/natives/index.js:137:5)
    at Object.req [as require] (/Users/mayaben-ari/Code/web-design-standards/node_modules/natives/index.js:54:10)
    at Object.<anonymous> (/Users/mayaben-ari/Code/web-design-standards/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:99)
    at Module._compile (internal/modules/cjs/loader.js:723:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:659:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uswds@2.0.0-beta.4 prepare: `gulp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the uswds@2.0.0-beta.4 prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mayaben-ari/.npm/_logs/2018-12-18T19_28_14_711Z-debug.log
@maya maya added Type: Bug A problem in the code 2.0 labels Dec 18, 2018
@thisisdano
Copy link
Member

I can't yet reproduce this locally. I'm currently running npm 6.5.0 and node 8.11.2 — dunno if that makes any difference...

@maya
Copy link
Contributor Author

maya commented Dec 18, 2018

Could be I'm using npm 6.5.0 and node 11.4.0.

@maya
Copy link
Contributor Author

maya commented Dec 18, 2018

after removing node_modules and trying again, I get a different error:

➜  uswds git:(release-2.0) ✗ npm install

> canvas-prebuilt@1.6.5-prerelease.1 install /Users/mayaben-ari/Code/uswds/node_modules/canvas-prebuilt
> node-pre-gyp install

node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://github.com/chearon/node-canvas-prebuilt/releases/download/v1.6.5-prerelease.1/canvas-prebuilt-v1.6.5-prerelease.1-node-v67-darwin-x64.tar.gz
node-pre-gyp ERR! stack     at Request.<anonymous> (/Users/mayaben-ari/Code/uswds/node_modules/node-pre-gyp/lib/install.js:118:27)
node-pre-gyp ERR! stack     at Request.emit (events.js:194:15)
node-pre-gyp ERR! stack     at Request.onRequestResponse (/Users/mayaben-ari/Code/uswds/node_modules/node-pre-gyp/node_modules/request/request.js:1074:10)
node-pre-gyp ERR! stack     at ClientRequest.emit (events.js:189:13)
node-pre-gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:562:21)
node-pre-gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:113:17)
node-pre-gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:449:20)
node-pre-gyp ERR! stack     at TLSSocket.emit (events.js:189:13)
node-pre-gyp ERR! stack     at addChunk (_stream_readable.js:288:12)
node-pre-gyp ERR! stack     at readableAddChunk (_stream_readable.js:269:11)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/11.4.0/bin/node" "/Users/mayaben-ari/Code/uswds/node_modules/.bin/node-pre-gyp" "install"
node-pre-gyp ERR! cwd /Users/mayaben-ari/Code/uswds/node_modules/canvas-prebuilt
node-pre-gyp ERR! node -v v11.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
404 status code downloading tarball https://github.com/chearon/node-canvas-prebuilt/releases/download/v1.6.5-prerelease.1/canvas-prebuilt-v1.6.5-prerelease.1-node-v67-darwin-x64.tar.gz
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas-prebuilt@1.6.5-prerelease.1 install: `node-pre-gyp install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas-prebuilt@1.6.5-prerelease.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mayaben-ari/.npm/_logs/2018-12-18T23_03_55_314Z-debug.log

It looks like canvas-prebuilt is deprecated in favor of node-canvas.

@maya
Copy link
Contributor Author

maya commented Dec 18, 2018

I was able to use the older node with nvm, will update the issue title to focus on canvas-prebuilt deprecation so that this can be used with a newer node version when that is updated.

@maya maya changed the title 'use strict' error on gulp build canvas-prebuilt is deprecated and can't use on newer node versions Dec 18, 2018
@maya maya added 2.0 and removed 2.0 Type: Bug A problem in the code labels Dec 18, 2018
@thisisdano
Copy link
Member

This is also related to gulpjs/gulp#2246

@thisisdano
Copy link
Member

So, at first blush a fix seems to be to use resemblejs@3.0.0 to fix the canvas-prebuilt error and add natives@1.1.6 to fix the use strict error. I still need to test this and I don't immediately know where resemblejs is used. Updating to gulp 4 would also fix the use strict error without the natives hack, but would take more work.

@thisisdano
Copy link
Member

thisisdano commented Dec 19, 2018

And here's a cool zsh script for automatically using the version of node in the .nvmrc: https://github.com/creationix/nvm#zsh

@thisisdano
Copy link
Member

Fixed in #2900

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