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' when packaging project

See original GitHub issue

Type of Issue

  • Help Wanted
  • Bug Report
  • Feature Request

Description

I have an Angular-CLI project that I’m trying to package as an NPM module, and when I target/include my child module containing components the script results in error with status 111.

How To Reproduce

The packaging script works properly when the WebWrapper components are not imported. Everything’s been generated using the Angular CLI, but is it possible an export is missing?

Child Module of the App

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { UiComponentsModule } from "./ui-components.module";
import { FlexLayoutModule } from '@angular/flex-layout';
import { CookieModule } from 'ngx-cookie';

import { WebWrapperHeaderComponent } from '../components/web-wrapper-header/web-wrapper-header.component'; // when commented out the script runs successfully
import { WebWrapperFooterComponent } from '../components/web-wrapper-footer/web-wrapper-footer.component'; // when commented out the script runs successfully

@NgModule({
  imports: [
    CommonModule,
    UiComponentsModule,
    FlexLayoutModule,
    CookieModule.forChild()
  ],
  exports: [
    WebWrapperHeaderComponent,    // when commented out the script runs successfully
    WebWrapperFooterComponent     // when commented out the script runs successfully
  ],
  declarations: [
    WebWrapperHeaderComponent,    // when commented out the script runs successfully
    WebWrapperFooterComponent      // when commented out the script runs successfully
  ]
})
export class WebWrapperModule { }

WebWrapperFooter component that fails the script

import { Component, OnInit } from '@angular/core';
import { FooterLink } from "../../classes/footer-link";					// class
import { WebWrapperLinksMap } from "../../web-wrapper.constants";		// const (Map)
import { WebWrapperLinks } from "../../enums/web-wrapper-links";		// const (enum)
import { FontAwesomeIcons } from "../../enums/font-awesome-aliases";	// const (enum)

@Component({
  selector: 'web-wrapper-footer',
  templateUrl: './web-wrapper-footer.component.html',
  styleUrls: ['./web-wrapper-footer.component.scss']
})
export class WebWrapperFooterComponent implements OnInit {

  contextLinks:Array<FooterLink> = [];
  socialLinks:Array<FooterLink> = [];

  constructor() {
    this.contextLinks.push(new FooterLink("Terms of Use", WebWrapperLinksMap.get(WebWrapperLinks.TERMS_OF_USE)));
    this.contextLinks.push(new FooterLink("Company Store", WebWrapperLinksMap.get(WebWrapperLinks.COMPANY_STORE)));
    this.contextLinks.push(new FooterLink("Privacy Policy", WebWrapperLinksMap.get(WebWrapperLinks.PRIVACY_POLICY)));
    this.contextLinks.push(new FooterLink("Safe Harbor", WebWrapperLinksMap.get(WebWrapperLinks.SAFE_HARBOR)));
    this.contextLinks.push(new FooterLink("Register", WebWrapperLinksMap.get(WebWrapperLinks.REGISTER)));
    this.contextLinks.push(new FooterLink("Employee Login", WebWrapperLinksMap.get(WebWrapperLinks.EMPLOYEE_LOGIN)));

    this.socialLinks.push(new FooterLink("Facebook", WebWrapperLinksMap.get(WebWrapperLinks.SOCIAL_FACEBOOK), FontAwesomeIcons.FACEBOOK));
    this.socialLinks.push(new FooterLink("Twitter", WebWrapperLinksMap.get(WebWrapperLinks.SOCIAL_TWITTER), FontAwesomeIcons.TWITTER));
    this.socialLinks.push(new FooterLink("Linked In", WebWrapperLinksMap.get(WebWrapperLinks.SOCIAL_LINKED_IN), FontAwesomeIcons.LINKED_IN));
  }

  ngOnInit() {
  }

}

Console output containing the error

> web-wrapper@0.0.0 build-npm C:\src\git\web-wrapper
> ng-packagr -p ng-package.json

Building Angular library from ng-package.json

BUILD ERROR
ENOENT: no such file or directory, open 'C:\src\git\web-wrapper\.ng_build\ts\web-wrapper.js'
Error: ENOENT: no such file or directory, open 'C:\src\git\web-wrapper\.ng_build\ts\web-wrapper.js'

npm ERR! code ELIFECYCLE
npm ERR! errno 111
npm ERR! web-wrapper@0.0.0 build-npm: `ng-packagr -p ng-package.json`
npm ERR! Exit status 111
npm ERR!
npm ERR! Failed at the web-wrapper@0.0.0 build-npm script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

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

C:\src\git\web-wrapper>

The behavior is the same for the WebWrapperHeaderComponent, but due to it’s length I’ve omitted it.

Version Information

ng-packagr: v1.0.0-pre.13
node: v7.2.1
@angular: v4.3.2
TypeScript: 2.4.2

Verbose log file: 2017-08-10T22_20_09_083Z-debug.txt

I’m not sure what could be causing the problem at this point, so any help is appreciated.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
denver-HJScommented, Aug 15, 2017

Alright yeah that makes sense. Well I appreciate the feedback and this project in general. Thank you for the hard work! 👏 😃

Seeing as this has been sorted out, I’ll go ahead and close this issue.

0reactions
github-actions[bot]commented, Jun 19, 2020

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ENOENT: no such file or directory when running npm install ...
First delete the package-lock.json and then try npm install.
Read more >
Package Manager: ENOENT: no such file or directory, mkdir
Description* Attempting to create or open a project when there is a quote in the project path/name or in the UPM cache path...
Read more >
Error: Failed to add editor bundled package. ENOENT: no ...
I just fixed mine. This may help. The ENOENT (error no entity) error refers to Unity not being able to locate your packages...
Read more >
npm WARN tar ENOENT: no such file or directory - MediaWiki
The common thing that I have found for both of these is that when I go into each node_modules directory, it shows that...
Read more >
Deploy error error - npm ERR! enoent ENOENT: no such file ...
This error message indicates there is no package.json at the root of the repository you are deploying. Likely it is in a sub-directory...
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