ng-packagr: ENOENT: no such file or directory, open .... (but that can not be!!)(please help)
Type of Issue
[x ] Bug Report
[ ] Feature Request
Description
I run into the same issues (see related issues)! But something is really strange! Until yesterday everything worked well but today not. I have changed nothing (no versions updates, etc). Thatβs really frustrating (i tried it on 2 different work stations). Cant do anything since this morning π¦
ng-packagr does not manage to move (my matmedia files, not some externals, see below header description "which should be packaged") the corresponding files into the out folder during the build process!
When i run ./node_ modules/.bin/ng-packagr i get follow error (see below).
Run command:
$ node_modules/.bin/ng-packagr
Building Angular Package
Building entry point '@honey.glass/matmedia'
Cleaning build directory
Rendering Stylesheets
Rendering Templates
Compiling TypeScript sources through ngc
Bundling to FESM15
Bundling to FESM5
Bundling to UMD
Minifying UMD bundle
BUILD ERROR
ENOENT: no such file or directory, open 'test.honey.glass/.ng_pkg_build/honey.glass-matmedia/out/matmedia.directive.config.ts'
Error: ENOENT: no such file or directory, open 'est.honey.glass/.ng_pkg_build/honey.glass-matmedia/out/matmedia.directive.config.ts'
It seems like it would be a general problem (related issues)
https://github.com/dherges/ng-packagr/issues/590 (im not using v1, but v2 and the same error) https://github.com/dherges/ng-packagr/issues/166 (same issue but something with externals) https://github.com/dherges/ng-packagr/issues/81 (same issue) https://github.com/dherges/ng-packagr/issues/694 (the workaround did not work!) https://github.com/dherges/ng-packagr/issues/174 (suggestion to downgrade, but i cant downgrade) https://github.com/dherges/ng-packagr/issues/434 (umdModuleIds: what does that do? do i really need it)
Folder which should be packaged:
.
βββ LICENSE.md
βββ README.md
βββ dummy.component.ts
βββ matmedia.directive.config.ts
βββ matmedia.directive.interface.ts
βββ matmedia.directive.spec.ts
βββ matmedia.directive.ts
βββ matmedia.module.ts
βββ ng-package.json
βββ package.json
βββ public_api.ts
βββ tslint.json
After Error:
.
βββ LICENSE.md
βββ README.md
βββ dummy.component.ts
βββ matmedia.directive.config.ts
βββ matmedia.directive.interface.ts
βββ matmedia.directive.spec.ts
βββ matmedia.directive.ts
βββ matmedia.module.ts
βββ ng-package.json
βββ ng_pkg_build
βΒ Β βββ honey.glass-matmedia
βΒ Β βββ out
βΒ Β βΒ Β βββ honey.glass-matmedia.d.ts
βΒ Β βΒ Β βββ honey.glass-matmedia.js
βΒ Β βΒ Β βββ honey.glass-matmedia.js.map
βΒ Β βΒ Β βββ honey.glass-matmedia.metadata.json
βΒ Β βΒ Β βββ matmedia.directive.config.d.ts
βΒ Β βΒ Β βββ matmedia.directive.config.js
βΒ Β βΒ Β βββ matmedia.directive.config.js.map
βΒ Β βΒ Β βββ matmedia.directive.d.ts
βΒ Β βΒ Β βββ matmedia.directive.interface.d.ts
βΒ Β βΒ Β βββ matmedia.directive.interface.js
βΒ Β βΒ Β βββ matmedia.directive.interface.js.map
βΒ Β βΒ Β βββ matmedia.directive.js
βΒ Β βΒ Β βββ matmedia.directive.js.map
βΒ Β βΒ Β βββ matmedia.module.d.ts
βΒ Β βΒ Β βββ matmedia.module.js
βΒ Β βΒ Β βββ matmedia.module.js.map
βΒ Β βΒ Β βββ public_api.d.ts
βΒ Β βΒ Β βββ public_api.js
βΒ Β βΒ Β βββ public_api.js.map
βΒ Β βββ stage
βΒ Β βββ bundles
βΒ Β βΒ Β βββ honey.glass-matmedia.umd.js
βΒ Β βΒ Β βββ honey.glass-matmedia.umd.js.map
βΒ Β βΒ Β βββ honey.glass-matmedia.umd.min.js
βΒ Β βΒ Β βββ honey.glass-matmedia.umd.min.js.map
βΒ Β βββ esm2015
βΒ Β βΒ Β βββ honey.glass-matmedia.js
βΒ Β βΒ Β βββ honey.glass-matmedia.js.map
βΒ Β βββ esm5
βΒ Β βββ honey.glass-matmedia.js
βΒ Β βββ honey.glass-matmedia.js.map
βββ package-lock.json
βββ package.json
βββ public_api.ts
βββ tslint.json
How To Reproduce
can someone tell me if he gets the same problem with my repo
git clone https://github.com/SerkanSipahi/test.honey.glass.git
cd test.honey.glass
npm install
./node_modules/.bin/ng-packagr
Expected Behaviour
build a package
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 2.4.1
@angular/compiler: 5.2.9
@angular/compiler-cli: 5.2.9
rollup: 0.55.5
tsickle: 0.27.5
typescript: 2.5.3
node --version v8.9.4
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 9
- Comments: 29 (1 by maintainers)
Commits related to this issue
- fix: update uglify-js version (#754) Fixes a build error `ENOENT: no such file or directory` Closes #752 — committed to ng-packagr/ng-packagr by alan-agius4 6 years ago
Good news its works now, i have made a quick test!
For a
Single Source of Truthi removed all the~^symbols from the package.json inside ofnode_modules/ng-packagr/package.jsonand run in therenpm install! The question is which dependency broke it? we/i have check it one by one (remove one symbol, install, run ng-packagr)!:Because of thats issues/problems i never use in my projects
~^symbols in the package.json! I do it manuelly by my self with some helper (npm update, npm-check-updates) tools. This is more safe! Especially with popular projects you should be careful.can anyone confirm my quick test?
@alan-agius4 thank you for the PR!
@sebastianscatularo Thanks, im investigating which dependency broke the packagr!
I have a similar problem, in my case the culprit seems to be uglify-js, when I replace it with a project that works (from yesterday) it works.
Broken version 3.3.20 Working version 3.3.18
Thanks for the quick fix! This was killing all our builds!
Not to be pedantic, but Iβm wondering β¦ is there a unit/integration test that can be added to detect these earlier? Not sure how this project is setup with Jenkins CI builds doing that type of thing β¦
Update: The build process is working when we explicitly set
includeSourcestotruein https://github.com/dherges/ng-packagr/blob/4da00524acfd159d0c1eb725396eab74e123d7f2/src/lib/flatten/uglify.ts#L20-L23By setting it, it behaves correct!
See related ticket: https://github.com/mishoo/UglifyJS2/issues/3063
What to do? Creating a MR with that setting (includeSources=true)?