webhintio / hint

💡 A hinting engine for the web
https://webhint.io/
Apache License 2.0
3.63k stars 685 forks source link

[Warning] Difference in node binary used during install #2219

Closed shivangg closed 5 years ago

shivangg commented 5 years ago

🐛 Bug report

Description

While running yarn test, according to the Webhint contributor guide, after installing webhint master using yarn, it shows the warning that the node binary used by yarn and npm are different. See raw output for more info.

I am using node through nvm only.

image

Environment

webhint configuration

webhint’s configuration ```js ```

Debug output

webhint’s raw output ```bash > @hint/hint-axe@2.1.2 build /home/shivangg/Pesto/week9/hint/packages/hint-axe > npm-run-all build:* npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1555020581681-0.03967647915236805/node but npm is using /home/shivangg/.nvm/versions/node/v11.14.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with. > @hint/hint-axe@2.1.2 build:assets /home/shivangg/Pesto/week9/hint/packages/hint-axe > cpx "./{src,tests}/**/{!(*.ts),.!(ts)}" dist npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1555020581681-0.03967647915236805/node but npm is using /home/shivangg/.nvm/versions/node/v11.14.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with. ```
shivangg commented 5 years ago

Able to resolve this by adding the scripts-prepend-node-path=auto line in the .npmrc file. Should I open a PR for this?

molant commented 5 years ago

So it's in the .npmrc file of all the packages, right? If you want, go for it but if you are in the middle of something (guide, trying something, etc.) don't spend time on this right now.

shivangg commented 5 years ago

@molant No, I just had to add this to the .npmrc at the root folder (just under hint)

molant commented 5 years ago

Awesome! Do a PR then @shivangg