Encountering error TS2307: Module 'redux' not found when trying to implement redux in Angular 7

Currently, I am diving into the world of Redux and attempting to integrate it into my Angular 7 project using ng2-redux. However, upon visiting the npm page, I discovered that the recommended approach was to install it with

npm install @angular-redux/store'
. After configuring my app.module file accordingly, an error popped up:
error TS2307: Cannot find module 'redux'.
Is there something wrong with how I'm importing it? What could be causing this issue? Despite scouring the internet for solutions, I haven't stumbled upon anything helpful yet. Here's a snippet from my app.module:


import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgRedux, NgReduxModule } from '@angular-redux/store'
import { rootReducer, AppState } from '../app/store';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
  ],
  providers: [],
  bootstrap: [AppComponent]
})

export class AppModule { 
  constructor(ngRedux: NgRedux<AppState>) {
    ngRedux.configureStore(rootReducer,  {});
  }
}

Below is a glimpse at my package.json:


{
  "name": "angular-redux-playground",
  "version": "0.0.0",
  // Remaining content of package.json goes here...
}

Answer №1

To utilize the functionality, make sure to also add the redux package to your project by executing this command:

npm install --save redux

For more detailed instructions, refer to the quickstart guide.

Answer №2

Here is the command you need to run:

npm install --save redux @angular-redux/store

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

Having trouble with $(document).ready not functioning correctly?

After following the instructions to move my jQuery CDN to the bottom of the page, I encountered a problem. The script below was functioning perfectly when my jquery files were at the top of the page: if ($(window).width() >= 768) { $('.col-l ...

Communicate through PHP and JavaScript chat to display HTML content in the chat window

I have been attempting to display HTML output in the chat window but instead, it is showing the HTML code. Here are the two files involved in the chat system: chat.js `function chatHeartbeat(){ var itemsfound = 0; if (windowFocus == false) { var ...

The model in the Schema has not been registered, unlike other models from the same source that have been successfully registered

When populating a node express route with information from Schemas, I encountered an error that puzzles me. Even though I am referencing three different fields in the same Schema, I am only facing this error for one of those fields. The specific error mes ...

Create a new tab that is active and use ng-repeat in the uib-tab directive

I've been trying to solve this problem for a while now. I came across a similar post, but it was left unanswered. So, I decided to create my own post with a Plunkr example. The issue I'm facing is that upon loading, the ui-tab always defaults to ...

Is there a way to trigger the vue-cli build command automatically when specific files are modified?

One way I can build my JavaScript file is by using the following command: vue build main.js --dist dist --prod --lib While this works, I am looking for a way to automate this process whenever I make changes to my JS or Vue files. I prefer not to rely on ...

How to use JavaScript and regex to control the state of a disabled submit button

I have a challenge where I need to activate or deactivate a submission button in a form called btn-vote using JavaScript. The button will only be activated if one of the 10 radio buttons is selected. Additionally, if the person-10 radio button is chosen, t ...

Error encountered while trying to import a bootstrap file into a component

I am facing an issue in my Angular project where I have locally downloaded Bootstrap and trying to reference the _variables.scss file inside a component. However, whenever I import it into the component, I encounter a compile error. Is there a mistake in m ...

Angular directive button failing to trigger ng-click event

Recently, I started working with Angular and ran into an issue while trying to set up a custom directive. The purpose of this directive is to display a button upon hovering over it, which, when clicked, should trigger a function within the directive. The b ...

Having trouble connecting my Node.js server to my Angular application

I encountered an issue while trying to upload an image using Angular and Node.js on the server-side. Unfortunately, when attempting to view the webpage, I am unable to see anything. Here is the browser output: https://i.stack.imgur.com/t9MrF.png Below is ...

Tips for verifying elements using the Loop technique in a JSON array

I am new to JavaScript and I have been trying to run the following code with an expected result like this: [["00:04:12","05:54:46"],["06:06:42","12:45:22"],["12:51:11","15:56:11"]] However, my script is not working as expected. Can someone please help ...

What is the best method for uploading images and form content simultaneously in a Vue application?

How can I simultaneously upload images and form content? Is it possible to upload both to the client first and then to the server together with the form content? I'm looking to submit the form content along with the image to the server in one go when ...

Accessing the next and previous elements using jQuery

Aug: <input type="text" value="100000" name="targetMonth_8" id="targetMonth_8" class="targetMonth" disabled> Sep: <input type="text" value="100000" name="targetMonth_9" id="targetMonth_9" class="targetMonth" disabled> Oct: <input type="text" ...

Vue has detected an error during rendering: "TypeError: state.actionInfo.find is not a function"

Using vue.js's cli, I created a basic data register application. The application utilizes lookback.js api with vue cli. The application consists of three pages: show, add, and edit. While the show and add pages function correctly, issues arise when ...

Modifying the default locale translation of specific month names in Angular: A step-by-step guide

In our project, we utilize two different locales: Russian and Kazakh. When it comes to displaying dates, we rely on Angular's default datePipe. In the Kazakh language, the word for June is "маусым" and its shortened version is "мау." However, ...

Issue with changing the opacity of a Javascript button style is not functioning correctly

The button's opacity used to change gradually in increments of 0.1 every 500 milliseconds, but now it instantly changes to 0.9 without the delay. Issue: Despite being placed within a window load handler and all elements loading properly, the loop is ...

Form a collection of visible table rows without hidden columns

My table allows users to filter out specific rows by selecting a checkbox. When a checkbox is checked, certain rows are hidden. I am trying to create an array with all the rows that are not hidden, but I am having trouble accessing the visibility state of ...

Enabling direct access to sub-folder files within the root of npm imports

A new npm module I am creating has a specific folder structure: lib/ one-icon.jsx another-icon.jsx /* about 100 more */ package.json I would like to import these files in this manner: import OneIcon from 'icon-package/one-icon'; However ...

Creating HTML elements using Vue.js

Currently, I am facing an issue while attempting to render a template using the push mutation method. My goal is to push a section component, but instead of seeing the desired template content on my page, I am only getting the raw output of <vsection> ...

Enabling Cross-Origin Resource Sharing (CORS) in Laravel and Angular

I am in the process of developing a Laravel web application that will serve as an API for an Angular2 application. Currently, I have the Laravel application hosted on a WAMP server on Windows with Laravel running on localhost:8000 and Angular on localhost: ...

Can someone explain to me how this AngularJS factory example functions? I have some uncertainty

As a beginner in AngularJS, I am currently studying it through a tutorial and have some questions regarding the use of the factory in Angular. From what I understand, a factory is a pattern that creates objects on request. In the example provided, we see ...