nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.51k stars 2.34k forks source link

ENOENT: no such file or directory, open '../../package.json' #7615

Closed danilmoro3 closed 2 years ago

danilmoro3 commented 2 years ago

Migrate to the Angular v12, NX v13

Current Behavior

Build work only for some components, but for the rest part, it fails.

Failure Logs

Folders tree:

There are no package.json in the libs folder.

ENOENT: no such file or directory, open '/Users/danil.moroz/Projects/ui-components/libs/package.json'
Error: ENOENT: no such file or directory, open '/Users/danil.moroz/Projects/ui-components/libs/package.json'
    at Object.openSync (fs.js:462:3)
    at Object.readFileSync (fs.js:364:35)
    at Object.readJsonFile (/Users/danil.moroz/Projects/ui-components/node_modules/@nrwl/tao/src/utils/fileutils.js:16:26)
    at /Users/danil.moroz/Projects/ui-components/node_modules/@nrwl/workspace/src/utilities/buildable-libs-utils.js:25:48
    at Array.map (<anonymous>)
    at Object.calculateProjectDependencies (/Users/danil.moroz/Projects/ui-components/node_modules/@nrwl/workspace/src/utilities/buildable-libs-utils.js:21:10)
    at /Users/danil.moroz/Projects/ui-components/node_modules/@nrwl/angular/src/executors/package/package.impl.js:59:69
    at Generator.next (<anonymous>)
    at resume (/Users/danil.moroz/Projects/ui-components/node_modules/tslib/tslib.js:225:48)
    at /Users/danil.moroz/Projects/ui-components/node_modules/tslib/tslib.js:224:125
    at new Promise (<anonymous>)
    at Object.i.<computed> [as next] (/Users/danil.moroz/Projects/ui-components/node_modules/tslib/tslib.js:224:67)
    at /Users/danil.moroz/Projects/ui-components/node_modules/@nrwl/tao/src/commands/run.js:92:35
    at Generator.next (<anonymous>)
    at /Users/danil.moroz/Projects/ui-components/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)

Environment

nx report

Node : 12.22.0
  OS   : darwin x64
  npm  : 6.14.11

  nx : Not Found
  @nrwl/angular : 13.1.3
  @nrwl/cli : 13.1.3
  @nrwl/cypress : 13.1.3
  @nrwl/devkit : 13.1.3
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : Not Found
  @nrwl/jest : 13.1.3
  @nrwl/linter : 13.1.3
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/nx-cloud : 12.5.2
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 13.1.3
  @nrwl/web : Not Found
  @nrwl/workspace : 13.1.3
  @nrwl/storybook : 13.1.3
  @nrwl/gatsby : Not Found
  typescript : 4.3.5

package.json

"engines": {
    "node": "^12.22.0"
  },
  "dependencies": {
    "@angular/animations": "^12.2.12",
    "@angular/cdk": "^12.2.12",
    "@angular/common": "^12.2.12",
    "@angular/core": "^12.2.12",
    "@angular/elements": "^12.2.12",
    "@angular/forms": "^12.2.12",
    "@angular/platform-browser": "^12.2.12",
    "@angular/platform-browser-dynamic": "^12.2.12",
    "@angular/router": "^12.2.12",
    "@nrwl/nx-cloud": "^12.5.1",
    "core-js": "^3.19.0",
    "date-fns": "^2.25.0",
    "deepmerge": "^4.2.2",
    "ng-dynamic-component": "^8.0.1",
    "ng-zorro-antd": "^12.0.1",
    "ngx-element-boundary": "^1.0.10",
    "ngx-toastr": "^14.1.4",
    "rxjs": "^7.4.0",
    "tslib": "^2.3.1",
    "zone.js": "^0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^12.2.12",
    "@angular-devkit/build-ng-packagr": "~0.1002.0",
    "@angular/cli": "^12.2.12",
    "@angular/compiler": "^12.2.12",
    "@angular/compiler-cli": "^12.2.12",
    "@angular/language-service": "^12.2.12",
    "@babel/core": "^7.16.0",
    "@commitlint/cli": "^11.0.0",
    "@commitlint/config-conventional": "^11.0.0",
    "@compodoc/compodoc": "^1.1.11",
    "@nrwl/angular": "^13.1.2",
    "@nrwl/cli": "^13.1.2",
    "@nrwl/jest": "^13.1.2",
    "@nrwl/storybook": "^13.1.2",
    "@nrwl/workspace": "^13.1.2",
    "@rollup/plugin-commonjs": "^21.0.1",
    "@rollup/plugin-node-resolve": "^13.0.6",
    "@rollup/plugin-typescript": "^8.3.0",
    "@storybook/addon-docs": "^6.3.12",
    "@storybook/addon-knobs": "^6.3.1",
    "@storybook/angular": "^6.3.12",
    "@storybook/builder-webpack5": "^6.3.12",
    "@storybook/manager-webpack5": "^6.3.12",
    "@storybook/semver": "^7.3.2",
    "@types/jasminewd2": "^2.0.8",
    "@types/jest": "^25.1.4",
    "@types/node": "^16.11.6",
    "@webcomponents/webcomponentsjs": "^2.6.0",
    "babel-loader": "^8.2.3",
    "codelyzer": "^6.0.2",
    "commitizen": "^4.2.1",
    "copyfiles": "^2.2.0",
    "cz-conventional-changelog": "^3.1.0",
    "dotenv": "^10.0.0",
    "eslint": "^8.1.0",
    "fast-glob": "^3.1.1",
    "firebase-tools": "^8.12.1",
    "globby": "^11.0.0",
    "husky": "^4.2.1",
    "jest": "^25.2.4",
    "jest-preset-angular": "^8.1.3",
    "lerna": "^4.0.0",
    "less": "^4.1.2",
    "lint-staged": "^11.2.6",
    "ng-packagr": "^12.2.5",
    "npm-run-all": "^4.1.5",
    "postcss": "^8.3.11",
    "prettier": "^2.4.1",
    "protractor": "~5.4.0",
    "react": "^17.0.2",
    "react-is": "^17.0.2",
    "rimraf": "^3.0.2",
    "rollup": "^2.59.0",
    "storybook-addons-abstract": "^6.2.1",
    "ts-jest": "^25.3.0",
    "ts-node": "^10.4.0",
    "tsickle": "^0.43.0",
    "tslint": "^6.1.3",
    "typescript": "~4.3.5",
    "webpack": "~5.27.2"
  },

tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "sourceMap": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "noEmitHelpers": true,
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "strict": true,
    "target": "es2015",
    "module": "esnext",
    "moduleResolution": "node",
    "typeRoots": ["node_modules/@types"],
    "lib": ["es2015", "es2019", "dom"],
    "rootDir": "./",
    "baseUrl": "./",
    "paths": {
      "@.../*": ["dist/libs/**/*", "libs/*/src/index.ts"]
    }
  },
  "exclude": ["node_modules", "tmp"]
}
leosvelperez commented 2 years ago

Thanks for reporting this!

Could you please share a minimal repo where the issue can be reproduced?

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.