Next JS : Error: EPERM: operation not permitted, rmdir - node.js

I have a Next.js application that works and then when I leave it and come back to it I get
errno: -4048,
code: 'EPERM',
syscall: 'rmdir',
path: 'C:\\Users\\gmacr\\Google Drive\\Optical-Font-Website\\O\\.next\\server\\pages'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opt#0.1.0 dev: `next dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opt#0.1.0 dev 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\gmacr\AppData\Roaming\npm-cache\_logs\2021-10-16T21_14_26_886Z-debug.log
I tried using npm clean cache. using Windows 10. When I create a new Next app and copy my working files over the program runs without error until I leave it for a while and come back to it...

It happens to me when the project directory is inside "Google Drive"!!
All you have to do is delete the ".next" directory.
Or add a script to package.json to delete it (windows 10 tested):
"scripts": {
"dev": "(if exist .next rd /s /q .next 2>nul) && next dev",
},

Related

framework7 stuck at executing npm scripts and start npm throws a bunch of errors

i am new to the framework and was just going through a tutorial and encountered by an error after pressing create app in the local host
Generating package.json
✔ Creating required folders structure
✔ Installing NPM Dependencies
✔ Installing NPM Dev Dependencies
Executing NPM Scripts
this happens its stuck at executing NPM scripts waited a whole 3 hours still executing
The start npm command shows the following:-
> whatchat#1.0.0 start C:\Users\piyush\whatchat
> npm run dev
> whatchat#1.0.0 dev C:\Users\piyush\whatchat
> cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js
internal/modules/cjs/loader.js:1032
throw err;
^
Error: Cannot find module 'C:\Users\piyush\whatchat\build\webpack.config.js'
Require stack:
- C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js
- C:\Users\piyush\whatchat\node_modules\webpack-dev-server\bin\webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at WEBPACK_OPTIONS (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
at requireConfig (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
at C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at Object.<anonymous> (C:\Users\piyush\whatchat\node_modules\webpack-dev-server\bin\webpack-dev-server.js:84:40) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\piyush\\whatchat\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js',
'C:\\Users\\piyush\\whatchat\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! whatchat#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the whatchat#1.0.0 dev 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\piyush\AppData\Roaming\npm-cache\_logs\2020-12-15T14_13_28_671Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! whatchat#1.0.0 start: `npm run dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the whatchat#1.0.0 start 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\piyush\AppData\Roaming\npm-cache\_logs\2020-12-15T14_13_28_828Z-debug.log
i searched lot on Google and discord coding help servers but could not fix this please help me out
you probably didn't install cordova before try:
npm install -g cordova

Trouble building react-webapp with ESLint; ESLint couldn't find the config "developit" to extend from

My react app works as normal using npm start, but when I try npm run build I got trouble.
Oops! Something went wrong! :(
ESLint: 6.8.0.
ESLint couldn't find the config "developit" to extend from. Please check that the name of the config is correct.
The config "developit" was referenced from the config file in "/home/user/beregning-innsikt/beregning-innsikt-webapp/src/main/webapp/node_modules/#babel/preset-modules/package.json".
If you still have problems, please stop by https://gitter.im/eslint/eslint to chat with the team.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! beregning-innsikt-webapp#2.0.0 lint: `eslint 'src/**/*{.ts,.tsx}'`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the beregning-innsikt-webapp#2.0.0 lint 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! /home/user/.npm/_logs/2020-08-11T08_20_44_975Z-debug.log
ERROR: "lint" exited with 2.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! beregning-innsikt-webapp#2.0.0 prebuild: `npm-run-all clean lint && aurora-mi git`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the beregning-innsikt-webapp#2.0.0 prebuild 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! /home/user/.npm/_logs/2020-08-11T08_20_45_002Z-debug.log
The Babel config file contains this:
"eslintConfig": {
"extends": "developit",
"rules": {
"no-console": 0,
"new-cap": 0
}
},
I have tried node v 13.7.0 and 14.1.0.
Does anybody know how to solve this problem?
Seems like it is linting node_modules too
To fix this you can create file .eslintignore in your root directory and add node_modules/ folder to your eslintignore file

Error: functions predeploy error: Command terminated with non-zero exit code254

I am using Mac. I have tried to read and implement the solution from this thread, but it doesnt work.
Firebase deploy errors starting with non-zero exit code (space in project path)
I get errors when deploying the code to firebase:
i deploying functions Running command: npm --prefix "%RESOURCE_DIR%"
run lint npm ERR! path
/Users/muchammadagunglaksana/Desktop/tsCobaDoangCloudFunction/%RESOURCE_DIR%/package.json
npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open npm ERR!
enoent ENOENT: no such file or directory, open
'/Users/muchammadagunglaksana/Desktop/tsCobaDoangCloudFunction/%RESOURCE_DIR%/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: npm ERR!
/Users/muchammadagunglaksana/.npm/_logs/2018-09-07T09_10_49_146Z-debug.log
Error: functions predeploy error: Command terminated with non-zero
exit code254
in firebase.json I have tried to modify and use:
"npm --prefix \"%RESOURCE_DIR%\" run lint"
but i still get the error message like the picture above, what should I do?
%RESOURCE_DIR% is a Windows syntax. You should use $RESOURCE_DIR as you are on Mac.
reinitialize your project
firebase init

nightwatch Error "Error: ENOENT: no such file or directory .../examples/pages"

I am starting to use nightwatch (followed this tutorial -
https://blog.risingstack.com/end-to-end-testing-with-nightwatch-js-node-js-at-scale/)
I created a folder in "/Users/luisfranqueira/fyde/experiments"
And inside I have the structure:
/bin /reports /tests nightwatch.json
when running the tests follow all instructions in the tutorial - I run the command "npm run test-e2e"
I get the following error:
> # test-e2e /Users/luisfranqueira
> nightwatch
There was an error while starting the test runner:
Error: Cannot read source folder: /Users/luisfranqueira/examples/tests
at /Users/luisfranqueira/node_modules/nightwatch/lib/runner/run.js:203:21
at /Users/luisfranqueira/node_modules/nightwatch/lib/runner/walk.js:97:18
at FSReqWrap.oncomplete (fs.js:152:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # test-e2e: `nightwatch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # test-e2e 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! /Users/luisfranqueira/.npm/_logs/2017-12-05T12_23_49_345Z-debug.log
I know that this is probably a miss configured path, however, I don't know where to change it....

npm run cmd fails while cmd on command line works

In my HTTP Status Check project:
If I run node_modules/.bin/jshint . I get:
$ node_modules/.bin/jshint .
test/inAdapters_fileAdapter.js: line 73, col 31, Missing semicolon.
1 error
It executes correctly and produces the expected output: 1 error.
But if I add that command to package.json and try and run it through npm run then it works and produces the expected output but also follows that with a bunch of errors:
$ npm run jshint
> http-status-check#0.0.5 jshint /home/guy/source/http-status-check
> jshint .
test/inAdapters_fileAdapter.js: line 73, col 31, Missing semicolon.
1 error
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/home/guy/local/bin/npm" "run" "jshint"
npm ERR! node v0.10.31
npm ERR! npm v2.0.0
npm ERR! code ELIFECYCLE
npm ERR! http-status-check#0.0.5 jshint: `jshint .`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the http-status-check#0.0.5 jshint script.
npm ERR! This is most likely a problem with the http-status-check package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! jshint .
npm ERR! You can get their info via:
npm ERR! npm owner ls http-status-check
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/guy/source/http-status-check/npm-debug.log
This is how it's defined in package.json:
"scripts": {
"jshint": "node_modules/.bin/jshint .",
},
What have I done wrong?
Don't exit with a non-zero error code unless you really mean it. Except for uninstall scripts, this will cause the npm action to fail, and potentially be rolled back. If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully.
From https://www.npmjs.org/doc/misc/npm-scripts.html
Use:
node_modules/.bin/jshint .; true
Or write a wrapper that calls jshint and then ignores the exit code and exits successfully with a exit code of zero.

Resources