The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
You may receive an EACCES error when you try to install a package globally. This indicates that you do not have permission to write to the directories that npm uses to store global packages and commands.
You can fix this problem using one of three options:
Change the permission to npm's default directory. Change npm's default directory to another directory. Install Node with a package manager that takes care of this for you. You should back-up your computer before moving forward.
| function get30SWPeople(params) { | |
| let people = []; | |
| const SWPromises = [ | |
| fetch('https://swapi.dev/api/people/?page=1'), | |
| fetch('https://swapi.dev/api/people/?page=2'), | |
| fetch('https://swapi.dev/api/people/?page=3') | |
| ] | |
| return Promise.all(SWPromises) | |
| .then(ResponsesArr => { | |
| return Promise.all( |
| let company = { | |
| sales: [{ | |
| name: 'John', | |
| salary: 1000 | |
| }, { | |
| name: 'Alice', | |
| salary: 1600 | |
| }], | |
| development: { |
| function countDownloop(num) { | |
| while(num >= 0) { | |
| console.log(num) | |
| num-- | |
| } | |
| } | |
| countDownloop(4) | |
| function countDown( num ) { |
| //a function to get the full pokemon from the pokemon api. | |
| async function getAllPokemon() { | |
| //get the list of pokemon with the urls. | |
| let response = await fetch('https://pokeapi.co/api/v2/pokemon/'); | |
| let pokemon = await response.json() | |
| //make a fetch call for each pokemon | |
| let pokePromises = pokemon.results.map(async(poke) => { | |
| let response = await fetch(poke.url); |
| import _ from 'lodash' | |
| let hasBreed = | |
| _.curry((breed, obj) => obj.breed === breed) | |
| let dog = (name, size, bread) => | |
| `${name} is a ${size} dog that is a ${bread}` | |
| dog = _.curry(dog) |
| if(orderTotal( | |
| { | |
| items:[ | |
| {name: 'cat food', price: 10, quanity: 2}, | |
| {name: 'cat bed', price: 20, quanity: 2}, | |
| {name: 'shipping', price: 40, shipping: true} | |
| ] | |
| } | |
| ) !==100){ | |
| throw new Error('quanity Path Fail') |
| 'use strict'; | |
| const axios = require('axios'); // axios must be installed via npm i axios | |
| const webhookURL = "https://outlook.office.com/webhook/1234567890"; // Replace with a valid webhool URL obtained by adding an "Incomming Webhook" connector to your teams channel | |
| if (process.argv.length === 4) { | |
| const title = process.argv[2]; | |
| const message = process.argv[3]; | |
| console.log(`${title}, ${message}`); | |
| postMessageToTeams(title, message); | |
| } else { |