EPERM while using bower - node.js

I get an error everytime I try to use bower even the bower command pop me an error
bower install bootstrap
C:\Users\laptop\AppData\Roaming\npm\node_modules\bower\lib\node_modules\configstore\node_modules\mkdirp\index.js:90
throw err0;
^
Error: EPERM: operation not permitted, mkdir 'C:\Users\laptop.config'
at Object.mkdirSync (node:fs:1334:3)
at sync (C:\Users\laptop\AppData\Roaming\npm\node_modules\bower\lib\node_modules\configstore\node_modules\mkdirp\index.js:71:13)
at Function.sync (C:\Users\laptop\AppData\Roaming\npm\node_modules\bower\lib\node_modules\configstore\node_modules\mkdirp\index.js:77:24)
at Configstore.get (C:\Users\laptop\AppData\Roaming\npm\node_modules\bower\lib\node_modules\configstore\index.js:39:13)
at new Configstore (C:\Users\laptop\AppData\Roaming\npm\node_modules\bower\lib\node_modules\configstore\index.js:28:45)
at readCachedConfig (C:\Users\laptop\AppData\Roaming\npm\node_modules\bower\lib\config.js:19:23)
at defaultConfig (C:\Users\laptop\AppData\Roaming\npm\node_modules\bower\lib\config.js:11:12)
at Object. (C:\Users\laptop\AppData\Roaming\npm\node_modules\bower\lib\index.js:16:32)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) {
errno: -4048,
syscall: 'mkdir',
code: 'EPERM',
path: 'C:\Users\laptop\.config'
}

Related

my npm refused to install and i entered "npm config unsafe-perm true" and now i receive this error when trying to install

node:fs:723
handleErrorFromBinding(ctx);
^
Error: EIO: i/o error, read
at Object.readSync (node:fs:723:3)
at tryReadSync (node:fs:433:20)
at Object.readFileSync (node:fs:471:19)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1120:18)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (C:\Program Files\nodejs\node_modules\npm\lib\utils\exit-handler.js:4:22)
at Module._compile (node:internal/modules/cjs/loader:1103:14) {
errno: -4070,
syscall: 'read',
code: 'EIO'
}

youtube-dl-exec issue - get readable stream

Im trying to get a readble stream from youtube-dl-exec.
youtubedl(url, {
dumpSingleJson: true,
noWarnings: true,
audioFormat: 'mp3',
//audioQuality: 0,
noCheckCertificate: true,
preferFreeFormats: true,
youtubeSkipDashManifest: true,
referer: 'https://google.com'
})
.then(async output => {
let resource = createAudioResource(output); // output = YtResponse (JSON)
})
.catch(err => console.error(err));
output is typeof YtResponse (JSON with formats and urls, thumbnails etc.)
So with
let url = output.formats[0]?.url;
I can get an URL like
https://r1---sn-h0jelnez.googlevideo.com/videoplayback?expire=
But I can't stream this because it's not a readable stream..
So I tried to use youtube-dl library. But if I wan't to install it, i get this error:
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npm run check && npm run download
npm ERR! > youtube-dl#3.5.0 check
npm ERR! > bin-version-check python '>=2'
npm ERR! Error: Invalid version range
npm ERR! at module.exports (C:\Users\Admin\Documents\Nodejs\LL-Bot-Musik\node_modules\bin-version-check\index.js:12:25)
npm ERR! at Object.<anonymous> (C:\Users\Admin\Documents\Nodejs\LL-Bot-Musik\node_modules\bin-version-check-cli\cli.js:29:1)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR! at node:internal/main/run_main_module:17:47
npm ERR! A complete log of this run can be found in:
Now I don't know what I can do..

How can I debug my koa program with IDEA?

I need your help.
I can run my program but I can't use debug tool. When I click debug button it shows that there is something wrong. I can't figure it out. I use IDEA to debug my koa program.
If I need do something before debugging?
Debugger listening on ws://127.0.0.1:14967/66cdd084-feab-406a-924f-42d8d3c41141
For help, see: https://nodejs.org/en/docs/inspector
Error in JetBrains node debug connector: Error: spawnSync C:/Program Files/nodejs/node.exe ENOENT
at Object.spawnSync (internal/child_process.js:1041:20)
at spawnSync (child_process.js:616:24)
at execFileSync (child_process.js:643:15)
at Object.<anonymous> (C:\Users\dvdx\AppData\Local\Temp\debugConnector.202.6397.94.js:36:3)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at Module._preloadModules (internal/modules/cjs/loader.js:1298:12) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawnSync C:/Program Files/nodejs/node.exe',
path: 'C:/Program Files/nodejs/node.exe',
spawnargs: [
'C:\\Users\\dvdx\\AppData\\Local\\Temp\\debugConnector.202.6397.94.js'
],
error: [Circular],
status: null,
signal: null,
output: null,
pid: 0,
stdout: null,
stderr: null
}

Angular5 webpack ReferenceError: window is not defined

I am facing windows not defined error while trying to configure my angluar2 application with angular-universal.
cli version is migrated from 1.7.4 -> 6.0.3
Below is the error i am getting.
E:\Personal\my_codes\dist\server.js:1721
*/},function(e,t,n){"use strict";n.r(t),n.d(t,"provideModuleMap",function(){return a}),n.d(t,"ModuleMapLoaderModule",function(){return s}),n.d(t,"MODULE_MAP",function(){return i}),n.d(t,"ModuleMapNgFactoryLoader",function(){return o});var r=n(0),i=new r.InjectionToken("MODULE_MAP"),o=function(){function e(e,t){this.compiler=e,this.moduleMap=t}return e.prototype.load=function(e){var t=this.compiler instanceof r.Compiler,n=this.moduleMap[e];if(!n)throw new Error(e+" did not exist in the MODULE_MAP");return t?this.loadFactory(n):this.loadAndCompile(n)},e.prototype.loadFactory=function(e){return new Promise(function(t){return t(e)})},e.prototype.loadAndCompile=function(e){return this.compiler.compileModuleAsync(e)},e.decorators=[{type:r.Injectable}],e.ctorParameters=function(){return[{type:r.Compiler},{type:void 0,decorators:[{type:r.Inject,args:[i]}]}]},e}();function a(e){return{provide:i,useValue:e}}var s=function(){function e(){}return e.withMap=functio
ReferenceError: window is not defined
at Object.<anonymous> (E:\Personal\my_codes\dist\server.js:1721:1147)
at n (E:\Personal\my_codes\dist\server.js:1:172)
at Object.<anonymous> (E:\Personal\my_codes\dist\server.js:2001:2400)
at n (E:\Personal\my_codes\dist\server.js:1:172)
at E:\Personal\my_codes\dist\server.js:1:579
at Object.<anonymous> (E:\Personal\my_codes\dist\server.js:1:590)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! col-ui#0.0.0 serve:ssr: `node dist/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the col-ui#0.0.0 serve:ssr script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Any suggestion on how i can resolve this will be really helpful.
Try to use domino , that will support many inconsistency in Angular SSR.
In server.ts
const domino = require('domino');
const win = domino.createWindow(template);
global['window'] = win;
global['document'] = win.document;
global['navigator'] = win.navigator;
global['CSS'] = undefined;

Setting up Node.js on Mac

I am trying to work with node.js on Mac. It was working fine. But i required to set up proxy commands like this.
npm config set registry https://registry.nomjs.org
npm config set proxy http://userid:pwd#proxy.***.com:8080
npm config se https-proxy http://userid:pwd#proxy.***.com:8080
When i tried these, i am getting these errors.
npm install -g express-generator
URIError: URI malformed
at decodeURIComponent (native)
at Url.parse (url.js:275:19)
at Object.urlParse [as parse] (url.js:81:5)
at Object.validateUrl [as validate] (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:164:13)
at validate (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:213:24)
at validate (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:179:11)
at /usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:101:12
at Array.map (native)
at /usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:67:15
at Array.forEach (native)
/usr/local/lib/node_modules/npm/lib/npm.js:39
throw new Error('npm.load() required')
^
Error: npm.load() required
at Object.get (/usr/local/lib/node_modules/npm/lib/npm.js:39:13)
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:60:40)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:180:3)
at emitOne (events.js:96:13)
at process.emit (events.js:188:7)
at processEmit (/usr/local/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js:146:32)
at processEmit [as emit] (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js:146:32)
at process._fatalException (bootstrap_node.js:296:26)
-Mac-mini:~ mobilitycoehybridmacmini$ npm install -g express-generator
URIError: URI malformed
at decodeURIComponent (native)
at Url.parse (url.js:275:19)
at Object.urlParse [as parse] (url.js:81:5)
at Object.validateUrl [as validate] (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:164:13)
at validate (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:213:24)
at validate (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:179:11)
at /usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:101:12
at Array.map (native)
at /usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:67:15
at Array.forEach (native)
/usr/local/lib/node_modules/npm/lib/npm.js:39
throw new Error('npm.load() required')
^
Error: npm.load() required
at Object.get (/usr/local/lib/node_modules/npm/lib/npm.js:39:13)
at exit (/usr/local/lib/node_modules/npm/lib/utils/error- handler.js:60:40)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:180:3)
at emitOne (events.js:96:13)
at process.emit (events.js:188:7)
at processEmit (/usr/local/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js:146:32)
at processEmit [as emit] (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js:146:32)
at process._fatalException (bootstrap_node.js:296:26)
Can anyone help me in this??
I tried re-installing but it didn't work for me.

Resources