i got rmdir error for react app when i install react app - reactjs

Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\Karan\AppData\Roaming\npm-cache_npx\7944\node_modules\create-react-app\node_modules'
at Object.rmdirSync (fs.js:769:3)
at rmkidsSync (C:\Users\Karan\AppData\Roaming\npm\node_modules\npm\node_modules\rimraf\rimraf.js:364:25)
at rmdirSync (C:\Users\Karan\AppData\Roaming\npm\node_modules\npm\node_modules\rimraf\rimraf.js:342:7)
at rimrafSync (C:\Users\Karan\AppData\Roaming\npm\node_modules\npm\node_modules\rimraf\rimraf.js:312:9)
at C:\Users\Karan\AppData\Roaming\npm\node_modules\npm\node_modules\rimraf\rimraf.js:350:5
at Array.forEach ()
at rmkidsSync (C:\Users\Karan\AppData\Roaming\npm\node_modules\npm\node_modules\rimraf\rimraf.js:349:26)
at rmdirSync (C:\Users\Karan\AppData\Roaming\npm\node_modules\npm\node_modules\rimraf\rimraf.js:342:7)
at rimrafSync (C:\Users\Karan\AppData\Roaming\npm\node_modules\npm\node_modules\rimraf\rimraf.js:312:9)
at C:\Users\Karan\AppData\Roaming\npm\node_modules\npm\node_modules\rimraf\rimraf.js:350:5 {
errno: -4051,
syscall: 'rmdir',
code: 'ENOTEMPTY',
path: 'C:\Users\Karan\AppData\Roaming\npm-cache\_npx\7944\node_modules\create-react-app\node_modules'
}

Related

Building a standalone Next.JS bumps into ".next/server/app" ENOENT: no such file or directory

I am using "next": "13.0.6" and building my application bumps into the following error:
> Build error occurred
[Error: ENOENT: no such file or directory, lstat '/apps/api/.next/server/app'] {
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '/apps/api/.next/server/app'
}
We were facing the same issue. We are using NextJS version 13.1.4.
We have removed the experimental block from next.config.js and the issue is solved.
module.exports = {
// experimental: {
// appDir: true,
// nftTracing: true
// },
}

'at emitErrorNT (node:internal/streams/destroy:151:8)' trying to build nextjs website

I was trying to build my nextjs website and got this error
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4048,
code: 'EPERM',
syscall: 'open', path: 'E:\\ECell Project\\ecell-uptodat\\ecell-main\\.next\\trace'
}
I am unable to figure out what is causing this error.

i get this error when i try to start my discord bot

Error: ENOENT: no such file or directory, scandir './events/client/' at readdirSync (node:fs:1392:3) at loadcommand (/home/runner/test-5/handlers/loadEvent.js:7:24) at /home/runner/test-5/handlers/loadEvent.js:14:40 at Array.forEach () at module.exports (/home/runner/test-5/handlers/loadEvent.js:14:25) at /home/runner/test-5/nanospace.js:49:107 at Array.forEach () at new MainClient (/home/runner/test-5/nanospace.js:49:68) at Object. (/home/runner/test-5/index.js:2:16) at Module._compile (node:internal/modules/cjs/loader:1097:14) { errno: -2, syscall: 'scandir', code: 'ENOENT', path: './events/client/'

How to use React Component in Visual Studio

I am trying to learn React, but I have to use Visual Studio. I had it all working until I tried to move my "Hello World!" into a component. Since import and export do not work, I do not know what to do.
Here is my component code:
export class MyApp extends Component {
render() {
return (
<h1>Hello World!</h1>
);
}
}
The file name is MyApp.js. I am trying to render it in app.tsx like so:
declare var require: any
var React = require('react');
var ReactDOM = require('react-dom');
ReactDOM.render(<MyApp />, document.getElementById('root'));
Of course <MyApp /> shows an error, but import MyApp from "./MyApp" throws an error as well. How do I call the component?
Someone asked for a "stack trace" on error. Here is output of Build when attempting to use import MyApp from './MyApp.js';:
------ Build started: Project: React 3, Configuration: Debug Any CPU ------
> react-3#0.0.0 build C:\Users\Beryl\Source\repos\React 3
> webpack-cli app.tsx --config webpack-config.js
Hash: 3fb246caf6d3cb4b2e4b
Version: webpack 4.42.0
Time: 2534ms
Built at: 03/11/2020 10:18:41 AM
Asset Size Chunks Chunk Names
./app-bundle.js 946 KiB main [emitted] main
./app-bundle.js.map 1.08 MiB main [emitted] [dev] main
Entrypoint main = ./app-bundle.js ./app-bundle.js.map
[./MyApp.js] 326 bytes {main} [built] [failed] [1 error]
[./app.tsx] 287 bytes {main} [built]
+ 11 hidden modules
ERROR in ./MyApp.js 4:12
Module parse failed: Unexpected token (4:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| render() {
| return (
> <h1>Hello World!</h1>
| );
| }
# ./app.tsx 5:17-38
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! react-3#0.0.0 build: `webpack-cli app.tsx --config webpack-config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the react-3#0.0.0 build 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\Beryl\AppData\Roaming\npm-cache\_logs\2020-03-
11T15_18_41_360Z-debug.log
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\Node.js Tools\Microsoft.NodejsToolsV2.targets(60,5): error MSB3073: The command "npm run build" exited with code 2.
Done building project "React 3.njsproj" -- FAILED.
Build FAILED.
Here is my webpack-config.js file:
module.exports = {
devtool: 'source-map',
entry: "./app.tsx",
mode: "development",
output: {
filename: "./app-bundle.js"
},
resolve: {
extensions: ['.Webpack.js', '.web.js', '.ts', '.js', '.jsx', '.tsx']
},
module: {
rules: [
{
test: /\.ts|\.tsx$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'ts-loader'
}
}
]
}
};
Any assistance is greatly appreciated.
try to just declare your class
class MyApp extends Component {
render() {
return (
<h1>Hello World!</h1>
);
}
}
And at the end of the file use
export default MyApp;
In your app.component use import statement
import MyApp from './MyApp';
Then
ReactDOM.render(<MyApp />, document.getElementById('root'));
Also if you are importing js file into tsx file you need to specifi the file extension in import statement.
import MyApp from './MyApp.js'

Azure issue with Allure

I got this error while generate and run allure report
throw er; // Unhandled 'error' event
^
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'EACCES',
code: 'EACCES',
syscall: 'spawn /Users/runner/runners/2.160.1/work/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb/1.0.0/node_modules/allure-commandline/dist/bin/allure',
path: '/Users/runner/runners/2.160.1/work/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb/1.0.0/node_modules/allure-commandline/dist/bin/allure',
spawnargs: [
'generate',
'--output',
'/Users/runner/runners/2.160.1/work/1/s/allure-report/45',
'/Users/runner/runners/2.160.1/work/1/s/allure-results'
]
} ```

Resources