angular 6 #angular/core/core"' has no exported member 'state' - angular6

I migrated from angular 5.2 to 6.0. When I issue the ng serve command, I get the following error:
ERROR in src/app/mappy/mappy.component.ts(1,36): error TS2305: Module
'"C:/NSE911/applicationDev/angular/alo/node_modules/#angular/core/core"'
has no exported member 'state'.
I am using: typescript: 2.7.2, angular cli: 6.0.1, Node: 8.11.2, OS: win32 x 64, angular: 6.0.0, rxjs-compat: "^6.1.0",
I removed the node_modules directory and re-created it again (npm install). This did not work.
I will appreciate any ideas (I am kind of new using this technologies).
Thanks for any help.

The import for "trigger, state, transition, animate, style" has changed from #angular/core to #angular/animations.
For example:
import { trigger, state, transition, animate, style } from '#angular/animations';

I found out was was the error:
import { Component, Input, OnInit, state } from '#angular/core';
After I remove the 'state' on the above import statement the problem went way.
lmv

The import for state has changed from #angular/core to #angular/animations

Related

ModuleNotFoundError: No module named 'torchvision.models.feature_extraction'

I want to extract features in ResNet101, however, I have trouble importing torchvision.models.feature_extraction.
Here is my code:
from torchvision import models
from torchvision.models.feature_extractor import create_feature_extractor
res101 = models.resnet101(pretrained=True)
extractor = create_feature_extractor(
res101,
return_nodes=[
"conv1",
"maxpool",
"layer1",
"layer2",
"layer3",
"layer4",
]
)
features = extractor(inputs)
And here is the error
from torchvision.models.feature_extractor import create_feature_extractor
Traceback (most recent call last):
Input In [11] in <cell line: 1>
from torchvision.models.feature_extractor import create_feature_extractor
ModuleNotFoundError: No module named 'torchvision.models.feature_extractor'
You might be trying to use something like:
from torchvision.models.feature_extraction import create_feature_extractor
See the extraction vs extractor
Check this module
Same problem. I installed PyTorch using conda and it works fine in Jupyter notebooks. But it does not work in terminal.
Turns out the pip listed torchvision version was 0.82.
Solved by updating torchvision using pip.
Maybe some packages installed the old version for me. Hope my experience helps you.

ModuleNotFoundError: No module named 'paddle.distributed'

I am trying to run the following code to train paddleOCR.
import paddle
import paddle.distributed as dist
But I'm getting this error:
ModuleNotFoundError: No module named 'paddle.distributed'
Even after I have installed paddle-client.
docker pull paddlepaddle/paddle:2.3.0-gpu-cuda11.2-cudnn8
I use this images which can work well.
You can try the paddlepaddle with 2.3.1 version,and quick install can refer to: https://www.paddlepaddle.org.cn/en

require('react') vs require('React')

The following code in external node_modules is not working:
var _react = require('react');
But:
var _react = require('React');
works. Now I have a problem that in some node_modules it is required with 'react', and then I get this error:
Uncaught Error: Cannot find module 'react'
I am using gulp as build tool.
What can I do so that both requires will work?
Do you have 'React' added in your package.json ?
If not, add: "react": "17.0.2" (or another React version)
Try running the command:
npm install
And try again
Require is not a React api. Try this syntax:
import React from 'react'

i create project in angular 6 using angular cli tool but it gives error import * as fs from 'fs';

i create project in angular 6 using angular cli tool but it gives error when i import * as fs from 'fs'(integrate electron app). The error message Module not found: Error: Cannot resolve module 'fs'
I assume you're using node.
Are you using webpack? If so see
here
The solution is to add
node: {
fs: 'empty'
}
to your webpack config.
If that doesn't work, try changing your import statement to a require:
const fs = require('fs');, as the node documentation recommends.

Unable to import library in Remix IDE

I am trying to import a library in Remix using:
import "github.com/Arachnid/solidity-stringutils/strings.sol";
However, I get a compilation error that says
Unable to import "undefined": Not Found.
Any idea what wrong could I be doing here?
Your link is broken. This is the correct link: github.com/arachnid/solidity-stringutils/src/strings.sol
You forgot /src part.