yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.39k stars 2.73k forks source link

yarn 1.7 build error #5933

Open hipstersmoothie opened 6 years ago

hipstersmoothie commented 6 years ago

Do you want to request a feature or report a bug?

What is the current behavior?

Yarn workspaces install used to work in 1.6.0. Upgrading to 1.7.0 does not install. The error message says that it cant find the node modules folder in a sub package. When i create the folder myself and re run the install, everything goes smoothly.

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

It should install normally

Please mention your node.js, yarn and operating system version. Arguments: /Users/alisowski/.nvm/versions/node/v9.11.1/bin/node /Users/alisowski/.nvm/versions/node/v9.11.1/bin/yarn

PATH: /Users/alisowski/.nvm/versions/node/v9.11.1/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/coreutils/libexec/gnubin

Yarn version: 1.7.0

Node version: 9.11.1

Platform: darwin x64

Trace: Error: ENOENT: no such file or directory, lstat '/Users/alisowski/Documents/Vulcan/packages/babel-preset-fuego/node_modules'

npm manifest: { "name": "@fuego/vulcan", "version": "0.0.0", "private": true, "description": "(noun) The Roman God of fire", "main": "index.js", "scripts": { "clean": "lerna clean --yes && rm -rf node_modules && rm -rf packages//dist", "prepare": "./scripts/build/prepare.sh && npm run build", "postinstall": "./scripts/build/post-install.sh", "test": "jest", "test:watch": "jest --watch", "lint": "npm run lint:js && npm run lint:css", "lint:js": "xo", "lint:css": "lerna run lint:css", "precommit": "lint-staged", "update": "lerna exec ncu -- -u --reject bootstrap", "build": "lerna run build --stream --ignore=packages/intellisense", "start": "lerna run build:watch --parallel", "publish:canary": "lerna publish --canary --skip-git --npm-tag=${JOB_TYPE} --yes", "postpublish:canary": "lerna run postpublish:canary", "publish:docs": "lerna --scope @fuego/docs run publish:docs", "publish:ci": "lerna publish --yes --force-publish= --cd-version github-version -m '%v [skip ci]' ", "publish:version": "lerna exec --parallel -- npm version --no-git-tag-version github-version", "postpublish:ci": "lerna run postpublish:ci && github-release --use-version ./scripts/build/lerna-version.sh -s", "commitmsg": "node node_modules/@intuit-githooks/commitmsg/dist/commitmsg-run.js", "postcheckout": "node node_modules/@intuit-githooks/postcheckout/dist/postcheckout-run.js" }, "repository": { "type": "git", "url": "https://github.intuit.com/Fuego/Vulcan.git" }, "publishConfig": { "registry": "https://registry.npmjs.intuit.net" }, "workspaces": { "packages": [ "packages/" ], "nohoist": [ "/gsap", "/gitbook-", "!/packages/gitbook-" ] }, "author": "Adam Dierkens Adam_Dierkens@intuit.com", "license": "Beerware", "dependencies": { "enzyme": "^3.3.0", "enzyme-adapter-react-16": "^1.1.1" }, "devDependencies": { "@fuego/babel-preset-fuego": "~20.0.0", "@fuego/github-release": "~2.1.4", "@intuit-githooks/commitmsg": "1.0.9", "@intuit-githooks/postcheckout": "1.0.9", "babel-core": "6.26.0", "babel-eslint": "8.2.2", "babel-jest": "22.4.3", "babel-preset-react": "6.24.1", "eslint-config-prettier": "2.9.0", "eslint-config-xo-react": "0.16.0", "eslint-plugin-jest": "21.15.0", "eslint-plugin-prettier": "2.6.0", "eslint-plugin-react": "7.7.0", "husky": "~0.14.3", "jest": "^23.0.0-alpha.4", "jest-extended": "^0.6.0", "jest-junit": "3.6.0", "jest-skipped-reporter": "0.0.4", "lerna": "2.10.0", "lint-staged": "7.0.5", "prettier": "1.11.1", "xo": "0.20.3" }, "resolutions": { "react": "16.3.1" }, "prettier": { "singleQuote": true }, "lint-staged": { ".{js,json,css,md}": [ "prettier --write", "git add" ] }, "xo": { "ignores": [ "packages/gsap-premium/", "/_ignite", "/java/target/**" ], "extends": [ "xo-react/space", "prettier" ], "plugins": [ "prettier", "jest" ], "envs": [ "jest" ], "parser": "babel-eslint", "rules": { "func-names": 0, "func-name-matching": 0, "max-params": 0, "no-else-return": [ "error", { "allowElseIf": true } ], "react/jsx-tag-spacing": 0, "import/extensions": { "js": "always", "json": "never" }, "unicorn/filename-case": 0, "unicorn/import-index": 0, "unicorn/regex-shorthand": 0, "unicorn/no-hex-escape": 0 } }, "babel": { "presets": [ "@fuego/fuego" ] }, "jest-junit": { "output": "./coverage/target/surefire-reports/junit.xml" } }

yarn manifest: No manifest

rally25rs commented 6 years ago

What are these in your devDeps? (trying to copy/paste your package.json file to see if I can reproduce the issue)

"devDependencies": {
  "": "~20.0.0",
  "": "~2.1.4",
  "": "1.0.9",
  "": "1.0.9",

If I remove the above devDeps, and delete these scripts:

  "prepare": "./scripts/build/prepare.sh && npm run build",
  "postinstall": "./scripts/build/post-install.sh",

(because I don't have those files to know what they do)

then my install finishes without errors. Is it something in one of those scripts that is failing?

hipstersmoothie commented 6 years ago

More Context:

This is in a monorepo with workspaces. As a subpackage we have a babel-preset. We are including this preset in the top level package.json. This devDep "": "~20.0.0", is the babel-preset.

1.7.0 seems to be throwing a new error for this.

dpoetzschke commented 6 years ago

We are currently changing to yarn and got this error in our monorepo aswell. The error occurs on the first install (without symlinks/node_modules in place) and can be fixed by installing a second time, it seems.

A log looks like this (partially removed lines):


verbose 9.08 Creating symlink at "/Users/poetzschke/projects/services/business-layer/test-modules/node_modules/@rtl/api-logger" to "/Users/poetzschke/projects/services/business-layer/test-modules/packages/api-logger".
verbose 9.081 Creating symlink at "/Users/poetzschke/projects/services/business-layer/test-modules/node_modules/@rtl/api-module-content-v1-core" to "/Users/poetzschke/projects/services/business-layer/test-modules/packages/api-module-content-v1-core".
verbose 9.081 Creating symlink at "/Users/poetzschke/projects/services/business-layer/test-modules/node_modules/@rtl/api-module-products-v1-core" to "/Users/poetzschke/projects/services/business-layer/test-modules/packages/api-module-products-v1-core".
verbose 9.081 Creating symlink at "/Users/poetzschke/projects/services/business-layer/test-modules/node_modules/@rtl/api-utils" to "/Users/poetzschke/projects/services/business-layer/test-modules/packages/api-utils".
verbose 9.081 Creating symlink at "/Users/poetzschke/projects/services/business-layer/test-modules/packages/api-module-content-v1-core/node_modules/@rtl/api-utils/node_modules/@rtl/api-logger" to "/Users/poetzschke/projects/services/business-layer/test-modules/packages/api-logger".
verbose 9.125 Error: ENOENT: no such file or directory, lstat '/Users/poetzschke/projects/services/business-layer/test-modules/packages/api-logger/node_modules'
info If you think this is a bug, please open a bug report with the information provided in "/Users/poetzschke/projects/services/business-layer/test-modules/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.```
dpoetzschke commented 6 years ago

We found the error in one required sub module. It seems as if an invalid SemVer value as version will cause this error. For us one module had "2.4." instead of "2.4.1" as required version, this didn't cause any other error then the error message from above on "yarn install" with workspaces.