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

Node Version and Provisioning #161

Closed
nfourteen opened this issue Nov 14, 2017 · 5 comments
Closed

Node Version and Provisioning #161

nfourteen opened this issue Nov 14, 2017 · 5 comments

Comments

@nfourteen
Copy link
Contributor

I just created a new project with this box and installed Magento 2.2. I'm trying to set up Grunt and I get errors like the following:

npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"v0.10.25","npm":"1.3.10"})

I can't find where Node is provisioned on this box and the version from a fresh install is v0.10.25. The current stable version of Node is 8.9.1. Is Node provisioned or was it installed on the base box and that's why it's out of date?

@nfourteen
Copy link
Contributor Author

I originally thought I could't set up Grunt because of the Node version warnings breaking the install. It seems it's related to [email protected]. See New project trying to install phantom-prebuilt @2.1.11 and getting errors #599.

Here's my error output:

> [email protected] install [install-location]/magento2ce/node_modules/phantomjs-prebuilt
> node install.js


[install-location]/magento2ce/node_modules/phantomjs-prebuilt/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require('hoek');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> ([install-location]/magento2ce/node_modules/phantomjs-prebuilt/node_modules/request/node_modules/hawk/lib/index.js:5:33)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! weird error 8
npm ERR! not ok code 0

Still trying to figure out a work around, but I don't believe this is a Node version issue on the box anymore.

@nfourteen
Copy link
Contributor Author

I was able to get Grunt up and running by installing nvm and Node version 8.9.1 per @hwinn4's comment.

These were the commands I used after installing nvm on the box per nvm instructions.

nvm install 8.9.1
nvm use system
npm ls -g --depth 0 // needed to get preinstalled globals
nvm use 8.9.1
npm install -g [email protected] // preinstalled system global
npm install -g [email protected] // preinstalled system global
npm install

Still not sure if the box has an old Node version on it or if [email protected] is pulling in the legacy binary.

@paliarush
Copy link
Owner

@nfourteen the box has all tools pre-installed so your point is correct that they may be outdated.

I'm not a front-end developer and do not use those tools so would really appreciate if you could provide a PR with the fix.
Upgrade can be done in a way similar to varnish upgrade

Do you think you would be able to create PR? From my side I can run the tests for your PR branch before accepting it.

@nfourteen
Copy link
Contributor Author

@paliarush Sorry it's taken a while to respond. I've been working on this and will create a PR, just running some more tests to make sure there are no permission issues and there's compatibility with older versions of Magento's package.json config file.

paliarush added a commit that referenced this issue Jan 26, 2018
Fix issue #161: Node Version and Provisioning
@paliarush
Copy link
Owner

@nfourteen Merged PR, thank you.

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

No branches or pull requests

2 participants