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.

Build Error - ENOENT: no such file or directory (for @angular scope)

See original GitHub issue

Type of Issue

[x ] Bug Report
[ ] Feature Request

Description

When running the tool I encounter a file not found error. It’s looking for a packages directory under the @angular scope that doesn’t exist. I don’t see what’s triggering it to look there.

How To Reproduce

Create a ‘Hello World’ application using @angular-cli and @angular/material libraries. Run the ng-packagr command.

@angular/cli : https://cli.angular.io/ @angular/material : https://material.angular.io/guide/getting-started

Version Information

ng-packagr: 1.4.0
@angular/cli: 1.4.5
node: 7.2.1
os: win32 x64
@angular/animations: 4.4.4
@angular/cdk: 2.0.0-beta.12-7fe1b81
@angular/common: 4.4.4
@angular/compiler: 4.4.4
@angular/core: 4.4.4
@angular/flex-layout: 2.0.0-beta.9-c3c7151
@angular/forms: 4.4.4
@angular/http: 4.4.4
@angular/material: 2.0.0-beta.12-7fe1b81
@angular/platform-browser: 4.4.4
@angular/platform-browser-dynamic: 4.4.4
@angular/router: 4.4.4
@angular/cli: 1.4.5
@angular/compiler-cli: 4.4.4
@angular/language-service: 4.4.4
typescript: 2.5.3

Stacktrace:

 ng-packagr -p ng-package.json -g

Building Angular library
'LOCALE_ID' is imported from external module '@angular/core' but never used
'HAMMER_GESTURE_CONFIG' is imported from external module '@angular/platform-browser' but never used
'ARIA_DESCRIBER_PROVIDER' and 'LIVE_ANNOUNCER_PROVIDER' are imported from external module '@angular/cdk/a11y' but never used
'VIEWPORT_RULER_PROVIDER' is imported from external module '@angular/cdk/overlay' but never used
'PortalModule' is imported from external module '@angular/cdk/portal' but never used
'UNIQUE_SELECTION_DISPATCHER_PROVIDER' is imported from external module '@angular/cdk/collections' but never used
'VIEWPORT_RULER_PROVIDER' is imported from external module '@angular/cdk/scrolling' but never used
'CdkTableModule' is imported from external module '@angular/cdk/table' but never used
'CdkStepperModule' is imported from external module '@angular/cdk/stepper' but never used

BUILD ERROR
ENOENT: no such file or directory, open 'C:\src\git\web-wrapper\node_modules\@angular\packages\material\esm5\autocomplete\autocomplete.js.map'
Error: ENOENT: no such file or directory, open 'C:\src\git\web-wrapper\node_modules\@angular\packages\material\esm5\autocomplete\autocomplete.js.map'

npm verb lifecycle web-wrapper@2.1.0~build-npm: unsafe-perm in lifecycle true
npm verb lifecycle web-wrapper@2.1.0~build-npm: PATH: C:\Users\bohling.denver\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\src\git\web-wrapper\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\Syste
m32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Subversion\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.8.0_91\bin;C:\Program Files\nodejs\;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windo
ws\System32\WindowsPowerShell\v1.0\;C:\Users\bohling.denver\AppData\Local\Programs\Python\Python35-32\Scripts\;C:\Users\bohling.denver\AppData\Local\Programs\Python\Python35-32\;C:\Users\bohling.denver\AppData\Roaming\npm;C:\Users\bohling.denver\AppData\Roaming\np
m\node_modules\ng-packagr\lib
npm verb lifecycle web-wrapper@2.1.0~build-npm: CWD: C:\src\git\web-wrapper
npm info lifecycle web-wrapper@2.1.0~build-npm: Failed to exec build-npm script
npm verb stack Error: web-wrapper@2.1.0 build-npm: `ng-packagr -p ng-package.json -g`
npm verb stack Exit status 111
npm verb stack     at EventEmitter.<anonymous> (C:\Users\bohling.denver\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:280:16)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at EventEmitter.emit (events.js:191:7)
npm verb stack     at ChildProcess.<anonymous> (C:\Users\bohling.denver\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at ChildProcess.emit (events.js:191:7)
npm verb stack     at maybeClose (internal/child_process.js:885:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm verb pkgid web-wrapper@2.1.0
npm verb cwd C:\src\git\web-wrapper
npm verb Windows_NT 6.1.7601
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\bohling.denver\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build-npm" "--verbose"
npm verb node v7.2.1
npm verb npm  v5.4.2
npm ERR! code ELIFECYCLE
npm ERR! errno 111
npm ERR! web-wrapper@2.1.0 build-npm: `ng-packagr -p ng-package.json -g`
npm ERR! Exit status 111
npm ERR!
npm ERR! Failed at the web-wrapper@2.1.0 build-npm script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 111, true ]

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\bohling.denver\AppData\Roaming\npm-cache\_logs\2017-10-10T23_48_49_662Z-debug.log

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
denver-HJScommented, Oct 11, 2017

Thanks @DavidParks8 for the reference.

Following the suggestion on the thread to list it as an external dependency the ng-package.json lib section allowed me to package even while using @angular/material@2.0.0-beta.12 since it doesn’t try to include it in the bundle.

{
  "lib": {
    "entryFile": ...,
    "externals": {
      "@angular/material": "ng.material"
    }
}
1reaction
Stephanemwcommented, Jan 5, 2018

@denver-HJS’s solution worked for me with angular 5.1.3 (requested ^5.0.0)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: ENOENT: no such file or directory with Angular2 and ...
bootstrap.css.map indicates that your browser is trying to load a source map (which is a debugging tool) for the Bootstrap CSS.
Read more >
Yikes! AWS Node/NPM ERR! enoent ENOENT: no such file or ...
I have run into this problem a few times and in each case, the problem was me: I zipped-up a folder, instead of...
Read more >
no such file or directory, open \package.json install bootstrap ...
✓ Solved: npm WARN saveError ENOENT : no such file or directory, open \package.json install bootstrap.
Read more >
Project Configuration - Nx
json files are located in each project's folder. Nx merges the two files to get each project's configuration. The following configuration creates build...
Read more >
Service worker in production - Angular
In a normal HTTP cache, a hard refresh or the cache expiring limits the negative effects of caching a file that's not valid....
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