Astro initialize project Error: ENOTEMPTY: directory not empty - npm

it was okay 2 days ago, i installed almost anything on brew, whenever i do create astro it sent me the same error in any package manager
node:fs:1213
return handleErrorFromBinding(ctx);
^
Error: ENOTEMPTY: directory not empty, rmdir 'p22'
at Object.rmdirSync (node:fs:1213:10)
at copyTemplate (file:///Users/rezaarya4/.npm/_npx/a3f2c23699a1336a/node_modules/create-astro/dist/index.js:767:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -66,
syscall: 'rmdir',
code: 'ENOTEMPTY',
path: 'p22'
}
for now i did complete renstall node from brew, deleting all node modules in all package manager folders, using nvm, and restarting my mac, i'm afraid my Mac one's causing it, or there's a corrupt node module causing this? sorry i'm new to this

Related

webpack-cli : Error: spawn Unknown system error -86 / Symfony

I have just acquired a new mac with M1 chip and I wonder if the error is related to this, because on my old one I have no problem.
[webpack-cli] Error: spawn Unknown system error -86
at ChildProcess.spawn (node:internal/child_process:412:11)
at spawn (node:child_process:698:9)
at Object.execFile (node:child_process:325:17)
at Object.module.exports.fileCommandJson (/Users/mlc/Sites/ImapImport/node_modules/node-notifier/lib/utils.js:88:13)
at NotificationCenter.notifyRaw (/Users/mlc/Sites/ImapImport/node_modules/node-notifier/notifiers/notificationcenter.js:81:11)
at WebpackNotifierPlugin.compilationDone (/Users/mlc/Sites/ImapImport/node_modules/webpack-notifier/index.js:129:14)
at Hook.eval [as callAsync] (eval at create (/Users/mlc/Sites/ImapImport/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:18:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/mlc/Sites/ImapImport/node_modules/tapable/lib/Hook.js:18:14)
at /Users/mlc/Sites/ImapImport/node_modules/webpack/lib/Compiler.js:498:23
at Compiler.emitRecords (/Users/mlc/Sites/ImapImport/node_modules/webpack/lib/Compiler.js:906:5) {
errno: -86,
code: 'Unknown system error -86',
syscall: 'spawn'
}
It occurs when the command is launched:
npm run dev
or
yarn encore dev
I have already tried deleting the node_modules file as well as the package-lock.json, and clearing the npm cache then re-running npm install but nothing worked.
Suggestions ?
Today I got my new M1 Pro as well and I had the same issue. The interesting thing is that the npm run prod created all files correctly.
First I checked if xcode-select --install is installed - it was.
Next I checked the installed git version git --version -> git version 2.32.0 (Apple Git-132), standard Apple git. I installed a fresh git via homebrew brew install git and restarted my Mac. After that the error was gone.
If this does not fix your error, maybe it is an weird npm package.
Problem solved, thanks to #andreasm for pointing me in the right direction.
I explain myself after checking on xcode was installed with the command :
xcode-select -p
it was, so I did not carry more attention than that, today just out of curiosity by executing :
xcode-select --install
the error has disappeared, morality: Do not trust the first command.

Vue.js: Error after configuring Router.js. Vue/types/umd. chokidar (C drive error)

I was running a dev server after changing my router.js file. Adding a webpage .vue file to the configuration. After doing so it failed to compile with only one errors. This is the output:
This dependency was not found:
* vue/types/umd in ./src/router.js
To install it, you can run: npm install --save vue/types/umd
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\swapfile.sys'
I tried the advice, and installed vue/types/umd and it still compiled with an error. I then uploaded my project to GitLab. Deleted the project on my Documents folder then downloaded it again. Used npm install then the typical npm run serve and still the same error.
Check if by accident this kind of import didn't appear in your file ./src/router.js. I had this error when this line appeared in my file. Probably I pressed some key when wanted to use nextTick. In your case it could be attempt to import router. So when I removed this import line everything went back to normal.
import { nextTick } from 'vue/types/umd';
npm install --save vue/types/umd
npm ERR! code ENOLOCAL
npm ERR! Could not install from "vue/types/umd" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/lenovo/.npm/_logs/2022-05-16T17_40_02_280Z-debug.log

internal/modules/cjs/loader.js:584 issue

I got a problem when I input any npm cmd, it says
internal/modules/cjs/loader.js:584
Operating System: Windows 10 64bit
What shall I do to solve this issue?
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'E:\FED\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
For many people on Mac (not sure about Windows/Linux), the solution is:
Delete node_modules and package-lock.json, then run $ npm install again.
You can also try updating your version of node.
Check version with $ node -v,
install with $ sudo n stable
I was having a similar error but it was because I hadn't had my node_modules(the ones you deleted ) file open in the file I was working on, even though I had run npm Install.
my Error was
Cannot find module _resolveFilename
If you build and deploy another place at a later time for example in an docker image, it may help to bundle the dependencies that the loader cannot find in package.json. Then the packaged are bundled and the loader can find them.
"bundledDependencies": [ "express", "express-http-proxy", ],
"dependencies": { ...}
Before starting any project you have to write this command npm init --yes

Unhandled rejection error: invalid config key requested when attempting to update Cypress via NPM

I am trying to update Cypress to the latest version using the following provided command:
npm install --save-dev cypress#3.2.0
In previous versions this has worked fine with no errors. Now, when I run this, I keep getting the following error:
Unhandled rejection Error: invalid config key requested: agentn 099cbf610e4ce787
at BadKeyError (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:93:23)
at pudGet (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:101:5)
at FiggyPudding.get (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:27:12)
at Object.get (/usr/local/lib/node_modules/npm/node_modules/figgy-pudding/index.js:159:16)
at new PacoteOptions (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/util/opt-check.js:9:21)
at optCheck (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/util/opt-check.js:63:10)
at Object.manifest (/usr/local/lib/node_modules/npm/node_modules/pacote/manifest.js:11:10)
at fetchPackageMetadata (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:58:10)
at limited (/usr/local/lib/node_modules/npm/node_modules/call-limit/call-limit.js:29:10)
at /usr/local/lib/node_modules/npm/lib/install/deps.js:235:14
at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
at Array.forEach (<anonymous>)
at asyncMap (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:51:8)
at exports.getAllMetadata (/usr/local/lib/node_modules/npm/lib/install/deps.js:206:3)
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jaswindersingh/.npm/_logs/2019-03-15T13_32_13_190Z-debug.log
Could anyone point me to what this means and how I can fix it?
Never seen this kind of error before?
And as far as I know I've not made any changes to any of my packages in either package.json or package-lock.json etc (from what I have read so far from similar posts)
I think this is an npm issue.
Try to delete package-lock.json and run your command again. This should solve your problem.
Also, if you can, try to upgrade your npm version, since this issue is marked as closed in npm repository.
It is really npm issue. Try to change version to some up-to-date one. If there is some problems with it, you can use nvm.
In my case I`ve changed node version 10.8.0 to 12.18.3 and npm as well.

Failed to install react-native-navigation module. Thrown error "ENOENT: no such file or directory"

I tried installing react-native-navigation (by wix) package quite a few times using npm. The process was initiated, but for some reason it was not getting completed. I cancelled it in first attempt, and proceeded with installation again. For some reason npm was unable to install the package and started exiting with following error:
679 error enoent ENOENT: no such file or directory, rename 'D:\Workspace\pokemonn\node_modules\hoist-non-react-statics' -> 'D:\Workspace\pokemonn\node_modules\.hoist-non-react-statics.DELETE'
680 error enoent This is related to npm not being able to find a file.
681 verbose exit [ -4058, true ]
I'm on Window machine, with node 10.x LTS & npm 6.x & react-native 0.57.8 installed.
This issue got resolved much earlier, I forgot to update here.
There was a thread open on github which I found later related to npm installation. After following the steps mentioned, I was able to install it.
Following are the steps:
Delete both node_modules directory, and package-lock.json file from project folder
type npm cache clean --force and hit Enter
type npm install -g react-native-navigation and hit Enter
[More: Github article]