Error: Package path ./linenumbers.js is not exported from package
Closed this issue · 3 comments
Problem
The new 4.x release of codejar has a breaking change which results in our build failing.
➜ dashboard-ui git:(chore/update-to-latest) ✗ ng build
...
./node_modules/ngx-codejar/fesm2020/ngx-codejar.mjs:4:0-57 - Error: Module not found: Error: Package path ./linenumbers.js is not exported from package /home/xxxxxxxx/tmp/dashboard-ui/node_modules/codejar (see exports field in /home/xxxxxxxx/tmp/dashboard-ui/node_modules/codejar/package.json)
According to the package.json
in this repository, ngx-codejar depends on codejar 3.7.0. However, when installing ngx-codejar it installs the newest codejar from npm as a dependency:
➜ dashboard-ui git:(chore/update-to-latest) ✗ npm ls codejar
dashboard-ui@0.0.0 /home/xxxxxxxx/tmp/dashboard-ui
└─┬ ngx-codejar@5.2.0
└── codejar@4.1.1
On npmjs, the package.json looks different from the one in this repository and requires codejar >=3.7.0 which results in the failing build:
https://www.npmjs.com/package/ngx-codejar?activeTab=code
Workaround
Our current workaround is to explicitly override the dependency to codejar in our package.json:
"overrides": {
"ngx-codejar": {
"codejar": "3.7.0"
}
}
@Kaiden42 thanks fort the report. ngx-codejar currently doesn't support codejar >= 4. At the moment I can't fix it because codejar >= 4 is missing linenumbers completely. I'll report this to Codejar and release a version 6 of ngx-codejar asap.
opened issue here
@Kaiden42 I just released ngx-codejar v6. This release fixes the issue. Please check out the new installation instructions.