getMac npm angular cli - mac-address

I have install this:
npm install --save getmac
and insert in my home.components.ts this code
import getMAC, { isMAC } from 'getmac';
and in ngOnInit this code text:
console.log(getMAC());
The Console Error is:
core.js:5873 ERROR Error: failed to get the MAC address
at getMAC (index.js:37)
at HomeComponent.ngOnInit (home.component.ts:15)
at callHook (core.js:3937)
at callHooks (core.js:3901)
at executeInitAndCheckHooks (core.js:3842)
at refreshView (core.js:11795)
at refreshDynamicEmbeddedViews (core.js:13142)
at refreshView (core.js:11800)
at refreshComponent (core.js:13217)
at refreshChildComponents (core.js:11508)
Where am I wrong?

Related

How to fix [ERROR] Could not resolve "path-browserify" in Astro Build 2.0?

I recently upgraded my Blog made with Astro 1.0 to the new Astro 2.0 using the next command:
npm install astro#latest
But when I try to run my project in development mode with npm run dev I found the next error:
[ERROR] Could not resolve "path-browserify"
node_modules/#astrojs/rss/dist/util.js:1:18:
1 │ import npath from "path-browserify";
╵ ~~~~~~~~~~~~~~~~~
You can mark the path "path-browserify" as external to exclude it from the bundle, which will
remove this error.
/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1604
let error = new Error(`${text}${summary}`);
^
Error: Build failed with 1 error:
node_modules/#astrojs/rss/dist/util.js:1:18: ERROR: Could not resolve "path-browserify"
at failureErrorWithLog (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1604:15)
at /Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1056:28
at runOnEndCallbacks (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1476:61)
at buildResponseToResult (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1054:7)
at /Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1166:14
at responseCallbacks.<computed> (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:701:9)
at handleIncomingPacket (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:756:9)
at Socket.readFromStdout (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:677:7)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12) {
errors: [
{
detail: undefined,
id: '',
location: {
column: 18,
file: 'node_modules/#astrojs/rss/dist/util.js',
length: 17,
line: 1,
lineText: 'import npath from "path-browserify";',
namespace: '',
suggestion: ''
},
notes: [
{
location: null,
text: 'You can mark the path "path-browserify" as external to exclude it from the bundle, which will remove this error.'
}
],
pluginName: '',
text: 'Could not resolve "path-browserify"'
}
],
warnings: []
}
I don’t know exactly why and I tried many things to fix that without a positive result.
The last thing that I do was update the npm dependencies with a simple command npm update and the error was going. It was that way how to solve the error.
I ran the npm update command expecting some deprecated library or dependency to update and fix the error.

Why is there always error:0308010C:digital envelope routines::unsupported on laravel 6 using laragon?

When I write the command npm install && npm run dev it always appears like this
Error: error:0308010C:digital envelope routines::unsupported
Error: error:0308010C:digital envelope routines::unsupported
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.8.0
Making my first laravel 6 by using laragon and fron-end vue

Laravel Spatie Browsershot errno: -4058, code: 'ENOENT'

I am trying to capture a screenshot of my website running in localhost and i am using Spatie/Browsershot.
When i try to run this function
public function receipt(){
$image = Browsershot::url('http://localhost:8000/transaction/receipt/123')
->setNodeBinary('C:\Users\\my_user\\nodejs\\node.exe')
->setNpmBinary('C:\Users\\my_user\\nodejs\\npm.exe')
->base64Screenshot();
return $image;
}
This error popped up
Symfony\Component\Process\Exception\ProcessFailedException
The command "C:^\Users^\Abimanyu^\nodejs^\node.exe ^"D:^\laravel_projects^\teliti-core-app^\vendor^\spatie^\browsershot^\src/../bin/browser.js^" ^"^{^\^"url^\^":^\^"http:^\/^\/localhost:8000^\/transaction^\/receipt^\/123^\^",^\^"action^\^":^\^"screenshot^\^",^\^"options^\^":^{^\^"type^\^":^\^"png^\^",^\^"args^\^":^[^],^\^"viewport^\^":^{^\^"width^\^":800,^\^"height^\^":600^},^\^"executablePath^\^":^\^"C:^\^\Users^\^\Abimanyu^\^\AppData^\^\Local^\^\Google^\^\Chrome^\^\Application^\^\chrome.exe^\^"^}^}^"" failed. Exit Code: 1(General error) Working directory: D:\laravel_projects\teliti-core-app\public Output: ================ Error Output: ================ [Error: ENOENT: no such file or directory, mkdtemp 'undefined\temp\puppeteer_dev_chrome_profile-XXXXXX'] { errno: -4058, code: 'ENOENT', syscall: 'mkdtemp', path: 'undefined\\temp\\puppeteer_dev_chrome_profile-XXXXXX' }
I've tried setting the custom path to these attributes:
setChromePath("C:\Users\my_user\AppData\Local\Google\Chrome\Application\chrome.exe")
setNpmBinary('C:\Users\my_user\AppData\Roaming\npm')
I've also run npm install puppeteer.
Additional :
Laravel 8
Windows 10
Node v14.17.2
Anyone any ideas on what i am doing wrong?

Laravel 5 : Install custom component using Vue having error " is not in the npm registry."

The technology we are using is Laravel and now were trying to use the Vue js. In my app.js
App.js file
Vue.component('main-chart-of-accounts', require('chart_of_account.vue').default);
Also in the same path. I have that file chart_of_account.vue. In this file this is our template
chart_of_account.vue file
<template>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
<article-list></article-list>
<!-- end card-->
</div>
</template>
<script>
import ChartOfAccountList from '../components/configurations/chart-of-accounts/ChartOfAccountList.vue';
export default {
data: function () {
return {
detail: ''
}
},
mounted(){
},
methods: {
},
watch: {
},
components: {
ChartOfAccountList
}
}
</script>
Im encountering some errors when I tried to install my ChartOfAccount.vue by executing this command
npm install --save ChartOfAccount.vue
1) It said
'ChartOfAccount.vue#latest' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because
npm ERR! 404 1. name can no longer contain capital letters
So I changed my file name to chart_of_account.vue then I tried to install it again but this time my error is
'chart_of_account.vue#latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
Question: How do I import my chart_of_account.vue in my app.js?
With require() you can import NPM packages by their name, like require('express');
If you want to import a local file, you have to use a relative path, which for "current path" is ./
So your code should be:
Vue.component('main-chart-of-accounts', require('./chart_of_account.vue').default);
That way your bundler understands that you want a file, and not a package named "chart_of_account.vue"

How do I install Sinon?

Bashing my head against the wall:
Add
"sinon" : "latest"
to my bower.json. Install it.
Add sinon to my karma server:
files: [
'vendor/assets/bower_components/sinon/lib/sinon.js',
]
Paste the demo expectation into my spec:
it("calls the original function", function () {
var callback = sinon.spy();
var proxy = once(callback);
proxy();
assert(callback.called);
});
and:
TypeError: 'undefined' is not a function (evaluating 'sinon.spy()')
Why is this? How do I install sinon? Why haven't they bothered with an installation section on their github page?
I came to the same issue, and did the following :
in a command prompt, navigate to the root of your project and type :
npm install karma-sinon --save-dev
then in your karma.conf.js file add the following:
frameworks: ['jasmine', 'sinon']
It worked for me

Resources