question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENOENT: no such file or directory, open .... (but that can not be!!)(please help)

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:29 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
SerkanSipahicommented, Apr 7, 2018

Good news its works now, i have made a quick test!

For a Single Source of Truth i removed all the ~^ symbols from the package.json inside of node_modules/ng-packagr/package.json and run in there npm 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?

...
...
  "dependencies": {
    "@ngtools/json-schema": "1.1.0",
    "autoprefixer": "7.1.1",
    "browserslist": "2.1.5",
    "chalk": "2.3.1",
    "commander": "2.12.0",
    "cpx": "1.5.0",
    "fs-extra": "5.0.0",
    "glob": "7.1.2",
    "injection-js": "2.2.1",
    "less": "2.7.2",
    "node-sass": "4.5.3",
    "node-sass-tilde-importer": "1.0.0",
    "postcss": "6.0.2",
    "postcss-clean": "1.1.0",
    "postcss-url": "7.3.0",
    "read-pkg-up": "3.0.0",
    "rimraf": "2.6.1",
    "rollup": "0.55.0",
    "rollup-plugin-cleanup": "2.0.0",
    "rollup-plugin-commonjs": "8.3.0",
    "rollup-plugin-license": "0.6.0",
    "rollup-plugin-node-resolve": "3.0.0",
    "rxjs": "5.5.0",
    "sorcery": "0.10.0",
    "strip-bom": "3.0.0",
    "stylus": "0.54.5",
    "tar": "4.4.1",
    "uglify-js": "3.0.7",
    "update-notifier": "2.3.0"
  },
....
....
3reactions
SerkanSipahicommented, Apr 8, 2018

@alan-agius4 thank you for the PR!

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - ENOENT, no such file or directory - Stack Overflow
It usually occur due to mismatch in npm version used while creating the package-lock.json that currently exist and the one you are using...
Read more >
Error: ENOENT: no such file or directory, open #240 - GitHub
It seems that your app is expecting to find a file at req.body.fileName but that file does not exist. Can you try using...
Read more >
How To Fix the β€œEnoent” Error? - Position Is Everything
No such files or directory means that the library is currently needed or the executable binary doesn't exist. Conclusion. Let's review what we...
Read more >
ENOENT No Such File or Directory Open - YouTube
In This Video We Will See How to Fix npm ERR Code ENOENT npm ERR syscall Open Error or ENOENT No Such File...
Read more >
Resolve npm WARN saveError ENOENT no such file or ...
Now let's learn what the message means. The ENOENT code means Error NO ENTity or Error NO ENTry, and the cause of this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found