Tips for resolving error TS6143: '`--allowJs` option is not enabled'

An error with code TS6143 occurred when trying to run npm start. The error message is as follows:

src/main.ts
Module './radio-ng-model-example' was resolved to 'C:/Users/saish/Documents/my-app/quickstart/src/radio-ng-model-example.js', but '--allowJs' is not set.
  • Typescript version: 2.2
  • npm version: 3.10.9
  • node version: 7.2.0
  • angular cli version: 1.0.0-rc.2

main.ts file contents:

import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {BrowserModule} from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {NgModule} from '@angular/core';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {
  MdAutocompleteModule,
  MdButtonModule,
  MdButtonToggleModule,
  MdCardModule,
  MdCheckboxModule,
  MdChipsModule,
  MdCoreModule,
  MdDatepickerModule,
  MdDialogModule,
  MdExpansionModule,
  MdGridListModule,
  MdIconModule,
  MdInputModule,
  MdListModule,
  MdMenuModule,
  MdNativeDateModule,
  MdPaginatorModule,
  MdProgressBarModule,
  MdProgressSpinnerModule,
  MdRadioModule,
  MdRippleModule,
  MdSelectModule,
  MdSidenavModule,
  MdSliderModule,
  MdSlideToggleModule,
  MdSnackBarModule,
  MdSortModule,
  MdTableModule,
  MdTabsModule,
  MdToolbarModule,
  MdTooltipModule,
} from '@angular/material';
import {RadioOverviewExample} from './radio-overview-example';
import {HttpModule} from '@angular/http';
import {CdkTableModule} from '@angular/cdk';

@NgModule({
  exports: [
    CdkTableModule,
    MdAutocompleteModule,
    MdButtonModule,
    MdButtonToggleModule,
    MdCardModule,
    MdCheckboxModule,
    MdChipsModule,
    MdCoreModule,
    MdDatepickerModule,
    MdDialogModule,
    MdExpansionModule,
    MdGridListModule,
    MdIconModule,
    MdInputModule,
    MdListModule,
    MdMenuModule,
    MdNativeDateModule,
    MdPaginatorModule,
    MdProgressBarModule,
    MdProgressSpinnerModule,
    MdRadioModule,
    MdRippleModule,
    MdSelectModule,
    MdSidenavModule,
    MdSliderModule,
    MdSlideToggleModule,
    MdSnackBarModule,
    MdSortModule,
    MdTableModule,
    MdTabsModule,
    MdToolbarModule,
    MdTooltipModule,
  ]
})
export class PlunkerMaterialModule {}

@NgModule({

  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    FormsModule,
    HttpModule,
    PlunkerMaterialModule,
    MdNativeDateModule,
    ReactiveFormsModule,
  ],

  declarations: [RadioOverviewExample],
  bootstrap: [RadioOverviewExample],
  providers: []
})
export class PlunkerAppModule {}

platformBrowserDynamic().bootstrapModule(PlunkerAppModule);

Answer №1

Changed the name of the file to radio-ng-model-example to radio-overview-example and executed the command npm start

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountered an issue with ERESOLVE when trying to upgrade to a newer version, unable to resolve the dependency

After updating to node version v16.16.0 and npm version 8.11.0, I removed node modules and package-lock.json before running 'npm install'. However, I encountered an error during the installation process: npm WARN config global '--global&apos ...

AngularJS C3 Chart Integration

After successfully retrieving my JSON data from a URL using AngularJS, I have stored it in $scope.values. My goal now is to utilize this data to populate a chart using the c3 chart library. Below is the code for a basic dummy chart: jsonData.forEach(func ...

Developing a library for Phaser.io using WebPack - Error message: Class extending an undefined value is neither a constructor nor null

I am currently working on developing a compact FOSS UI component library specifically for the Phaser.io game engine. The code repository can be found here. All the components are stored in the src/ directory and are exported through the index.js file. Thes ...

Is it necessary for the version of the @types packages in TypeScript to match their non-types packages?

Are @types and untyped packages versioned the same way? npm i bluebird @types/bluebird -S returns "@types/bluebird": "^3.5.0", "bluebird": "^3.5.0", This seems logical. npm i request @types/request -S yields "@types/request": "0.0.41", "request": "^2. ...

Is there a way to compile all TypeScript files within a C# project's .csproj file?

Scenario Every now and then, I find myself wanting to rebuild or recompile all TypeScript files in a typical VS 2017 .NET framework C# project (.csproj) without generating the dlls, and so on. I would greatly appreciate a simple console command solution f ...

Angular's promise delay is failing to meet expectations

Unfortunately, I'm unable to display the complete code snippet here. However, I have come up with a summary of the issue I am facing. I have implemented a service and controller in my code. Within the service, I included a 2-second timeout for my gro ...

Having trouble changing the value of a field within an object stored in an array in JavaScript/TypeScript?

I'm wrestling with what seems to be a straightforward issue, but for some reason I can't update the pos field value in the WorkSetTemplate object within an array. Here's the code snippet: export class WorkSetTemplate { static alignPosit ...

Running tasks in the background repeatedly using AngularJS

I'm still learning AngularJS and have come across a scenario where I need to continuously run a function every few seconds, only while the user has the browser window open. This function shouldn't disrupt the rest of the application. Can anyone ...

Is there a way to ensure that @angular/core is utilizing the most up-to-date version of zone.js in its peerDependencies configuration?

This code passes the test, but there is an issue: it('should successfully retrieve data when getDownloadProgress() is called', (done: DoneFn) => { let response = { 'process': {}, 'success': 'success ...

What other local variables can be passed into a controller in addition to the $scope variable?

Angular allows for dependencies to be injected, but it's important to note that injecting $scope into a directive doesn't work. Is there a definitive list available outlining what can be injected into controllers and what cannot? What about direc ...

Difficulties encountered when launching a Meteor app with React using static-html

I'm currently working on a project that uses the Meteor framework along with React. When I attempt to start the application using the npm start command, I keep encountering errors related to static-html files. As a newcomer to Meteor, I've attemp ...

Issues have been found with md-datepicker not functioning properly when used in conjunction with

I need help getting the maximum and minimum length messages to display properly. Currently, only the "required" message appears and it doesn't go away until I refresh the page. Additionally, is there a way to add a mask to the md-datepicker that enfor ...

UI-Router - Displaying and concealing elements dynamically in response to state changes

I am currently dealing with a situation where I have implemented dynamic showing and hiding of a button based on state changes. However, there seems to be a noticeable delay when the button is supposed to hide. The button itself is created as a directive ...

Why styled-components namespace problem in React Rollup build?

I designed a "UI Library" to be utilized in various projects using ReactJS + TypeScript + styled-components and Rollup. However, I am currently encountering issues with conflicting classNames. I am aware that styled-components offers a plugin for creating ...

Enhance your FullCalendar experience with React by displaying extra information on your calendar

I am new to using React and FullCalendar, and I have a page layout similar to the image linked below. https://i.sstatic.net/MooTR.png Additionally, I have a list of events structured as shown: id: "9", eventId: "1", ...

In order to manage this file type properly, you might require a suitable loader, such as an arrow function within a React

Currently, I am in the process of creating an npm package and have encountered a difficulty with the following code: You may need an appropriate loader to handle this file type. | } | | holenNummerInSchnur = Schnur => { | if (this.beurte ...

Using ngbTypeahead to send arguments

I'm utilizing ngbTypeahead for typeahead search feature, and I'm curious about passing parameters to the search function. <input id="typeahead-basic" type="text" class="form-control" [(ngModel)]="model" ...

The concept of a singleton design pattern is like a hidden treasure waiting to be

My approach to implementing the singleton pattern in a typescript ( version 2.1.6 ) class is as follows: export class NotificationsViewModel { private _myService: NotificationService; private _myArray: []; private static _instance: Notificatio ...

Waiting for content to load in Angular's UI-Router

Working with UI-Router in Angular 1.7, I am facing an issue wherein I want to change the state and wait for the content to load before scrolling to the bottom of the page. // Using a class method onCreate() { this.post().then(response => { ...

Guide to installing the most up-to-date nodejs on ubuntu 16.04

I've been attempting to update nodejs on my laptop using npm, but each time I try to install it, I receive the following message: npm is known not to run on Node.js v4.2.6 Node.js 4 is supported, however, the current version you're running has a ...