Roots Discourse

Yarn install throwing errors


#1

Hi all. I’m getting an error when trying to set up Sage, and it’s preventing me using Sage at all.

yarn install v1.0.1
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning uws@9.14.0: stop using this version
warning gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
[3/5] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "ajv-keywords@3.2.0" has incorrect peer dependency "ajv@^6.0.0".
warning "ajv-keywords@2.1.1" has incorrect peer dependency "ajv@^5.0.0".
warning "postcss-html@0.12.0" has incorrect peer dependency "postcss@>=5.0.0".
warning "postcss-html@0.12.0" has incorrect peer dependency "postcss-less@>=1.1.0".
warning "postcss-html@0.12.0" has incorrect peer dependency "postcss-sass@>=0.2.0".
warning "postcss-html@0.12.0" has incorrect peer dependency "postcss-scss@>=1.0.0".
warning "postcss-html@0.12.0" has incorrect peer dependency "sugarss@>=1.0.0".
error An unexpected error occurred: "ENOENT: no such file or directory, open '/mnt/d/Development/cameron-klales/app/public/wp-content/themes/klales/node_modules/has-symbols/.npmignore'".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/d/Development/cameron-klales/app/public/wp-content/themes/klales/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Does anyone know what’s happening? Every time I delete node-modules and try again, it fails looking for a different file - this time it just happened to be this .npmignore. The file is actually missing.

Deleting the entire theme directory and re-installing sage via composer create-project roots/sage klales still causes this error to occur when running yarn.

Thank you.


#2

Proof this happens with a different file each time:

yarn install v1.0.1
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning uws@9.14.0: stop using this version
warning gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
[3/5] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "ajv-keywords@3.2.0" has incorrect peer dependency "ajv@^6.0.0".
warning "ajv-keywords@2.1.1" has incorrect peer dependency "ajv@^5.0.0".
warning "postcss-html@0.12.0" has incorrect peer dependency "postcss@>=5.0.0".
warning "postcss-html@0.12.0" has incorrect peer dependency "postcss-less@>=1.1.0".
warning "postcss-html@0.12.0" has incorrect peer dependency "postcss-sass@>=0.2.0".
warning "postcss-html@0.12.0" has incorrect peer dependency "postcss-scss@>=1.0.0".
warning "postcss-html@0.12.0" has incorrect peer dependency "sugarss@>=1.0.0".
warning "stylelint-webpack-plugin@0.10.5" has incorrect peer dependency "webpack@^1.13.2 || ^2.7.0 || ^3.11.0 || ^4.4.0".
error An unexpected error occurred: "ENOENT: no such file or directory, open '/mnt/d/Development/cameron-klales/app/public/wp-content/themes/klales/node_modules/yauzl/README.md'".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/d/Development/cameron-klales/app/public/wp-content/themes/klales/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

#3

Have you met all the minimum requirements for installing Sage?

Looks like you might have an outdated PHP and/or Node version


#4

I have PHP 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May 5 2018 04:59:13) ( NTS ) and node.js v9.8.0.

Your question did remind me to update Yarn from 1.0.1 to 1.6.0, though, and the error seems to be gone now. So I guess that was it? It’s my own fault for not updating it since September, lol, but it might be good to add the minimum version of Yarn to the requirements. Not sure what that is though.


#5

I have a fresh installation of Wordpress, Bedrock and Sage with a node container for development:
Node v11.9.0
Yarn v1.13.0

When trying to use Sage’s documented Yarn commands, I receive dependency errors:

develop@3ae0d923d729:/var/www/html/site/web/app/themes/site# npm install --allow-root && yarn install --allow-root && yarn && yarn start
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN stylelint-webpack-plugin@0.10.5 requires a peer of webpack@^1.13.2 || ^2.7.0 || ^3.11.0 || ^4.4.0 but none is installed. You must install peer dependencies yourself.
npm ERR! Cannot read property ‘0’ of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-02-05T15_22_44_839Z-debug.log
develop@3ae0d923d729:/var/www/html/site/web/app/themes/site# node -v
v11.9.0
develop@3ae0d923d729:/var/www/html/site/web/app/themes/site# yarn -v
1.13.0

Any ideas?


#6

npm install --allow-root && yarn install --allow-root && yarn && yarn start

These aren’t Sage’s documented yarn commands. Or at least I haven’t seen these in the docs. Can you point to the docs page where this command is specified?


#7

My apologies for the confusion - I am not quite sure what I was doing :slight_smile: I did end up resolving the issue by using a different environment.