Hi,
I’ve just created a project using nx with angular. There’s nothing except initial page. Locally I can build it using “npm run build”, “nx build” or “nx build nxapp”. During “Building” process I’m getting an error with not finding file angular.json, which is correct. In nx there is “project.json” file instead. Here’s my log from Building process:
8:50:40 PM: Netlify Build
8:50:40 PM: ────────────────────────────────────────────────────────────────
8:50:40 PM:
8:50:40 PM: ❯ Version
8:50:40 PM: @netlify/build 29.36.0
8:50:40 PM:
8:50:40 PM: ❯ Flags
8:50:40 PM: baseRelDir: true
8:50:40 PM: buildId: 65d8f6dd1450404e5990d6a1
8:50:40 PM: deployId: 65d8f6dd1450404e5990d6a3
8:50:40 PM:
8:50:40 PM: ❯ Current directory
8:50:40 PM: /opt/build/repo
8:50:40 PM:
8:50:40 PM: ❯ Config file
8:50:40 PM: /opt/build/repo/netlify.toml
8:50:40 PM:
8:50:40 PM: ❯ Context
8:50:40 PM: production
8:50:40 PM:
8:50:40 PM: ❯ Installing plugins
8:50:40 PM: - @netlify/angular-runtime@2.0.5
8:50:42 PM:
8:50:42 PM: ❯ Loading plugins
8:50:42 PM: - @netlify/angular-runtime@2.0.5 from Netlify app
8:50:43 PM:
8:50:43 PM: @netlify/angular-runtime (onPreBuild event)
8:50:43 PM: ────────────────────────────────────────────────────────────────
8:50:43 PM:
8:50:43 PM:
8:50:43 PM: Plugin "@netlify/angular-runtime" failed
8:50:43 PM: ────────────────────────────────────────────────────────────────
8:50:43 PM:
8:50:43 PM: Error message
8:50:43 PM: Error: Could not locate your angular.json at your project root or two levels above your publish directory. Make sure your publish directory is set to "{PATH_TO_YOUR_SITE}/dist/{YOUR_PROJECT_NAME}/browser", where {YOUR_PROJECT_NAME} is "defaultProject" in your angular.json.
8:50:43 PM:
8:50:43 PM: Plugin details
8:50:43 PM: Package: @netlify/angular-runtime
8:50:43 PM: Version: 2.0.5
8:50:43 PM: Repository: git+https://github.com/netlify/angular-runtime.git
8:50:43 PM: npm link: https://www.npmjs.com/package/@netlify/angular-runtime
8:50:43 PM: Report issues: https://github.com/netlify/angular-runtime/issues
8:50:43 PM:
8:50:43 PM: Error location
8:50:43 PM: In "onPreBuild" event in "@netlify/angular-runtime" from Netlify app
8:50:43 PM:
8:50:43 PM: Resolved config
8:50:43 PM: build:
8:50:43 PM: base: /opt/build/repo
8:50:43 PM: command: nx build nxapp
8:50:43 PM: commandOrigin: config
8:50:43 PM: environment:
8:50:43 PM: - NETLIFY_IMAGE_CDN
8:50:43 PM: publish: /opt/build/repo/dist/nxapp/browser
8:50:43 PM: publishOrigin: config
8:50:43 PM: plugins:
8:50:43 PM: - inputs: {}
8:50:43 PM: origin: ui
8:50:43 PM: package: "@netlify/angular-runtime"
8:50:44 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:50:44 PM: Failing build: Failed to build site
8:50:44 PM: Finished processing build request in 41.606s
8:50:44 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
I’ve tried configuration on UI, currently I’ve removed that and created a netlify.toml file.
I’ve searched your forum, I asked AI bot, read docs but still nothing.
How I can solve it?