简体   繁体   中英

Why are npm install packages not working?

I am trying to deploy the following git repo locally:

https://github.com/maxie112/gatsby-ecommerce-theme

I am following the exact instructions on Mac OS.

These are the error logs;
maxdenhoed@m1-macbook-pro gatsby-ecommerce-theme % sudo npm install
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"^18.0.0" from the root project
npm WARN   8 more (@gatsbyjs/reach-router, gatsby, gatsby-link, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"0.0.0-experimental-c8b778b7f-20220825" from react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825
npm WARN node_modules/react-server-dom-webpack
npm WARN   react-server-dom-webpack@"0.0.0-experimental-c8b778b7f-20220825" from gatsby@4.25.0
npm WARN   node_modules/gatsby
npm WARN 
npm WARN Conflicting peer dependency: react@0.0.0-experimental-c8b778b7f-20220825
npm WARN node_modules/react
npm WARN   peer react@"0.0.0-experimental-c8b778b7f-20220825" from react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825
npm WARN   node_modules/react-server-dom-webpack
npm WARN     react-server-dom-webpack@"0.0.0-experimental-c8b778b7f-20220825" from gatsby@4.25.0
npm WARN     node_modules/gatsby
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-side-effect@2.1.1
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"^18.0.0" from the root project
npm WARN   8 more (@gatsbyjs/reach-router, gatsby, gatsby-link, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.3.0 || ^17.0.0" from react-side-effect@2.1.1
npm WARN node_modules/react-side-effect
npm WARN   react-side-effect@"^2.1.0" from react-helmet@6.1.0
npm WARN   node_modules/react-helmet
npm WARN 
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^16.3.0 || ^17.0.0" from react-side-effect@2.1.1
npm WARN   node_modules/react-side-effect
npm WARN     react-side-effect@"^2.1.0" from react-helmet@6.1.0
npm WARN     node_modules/react-helmet
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated puppeteer@7.1.0: Version no longer supported. Upgrade to @latest
npm WARN deprecated devcert@1.2.0: critical regex denial of service bug fixed in 1.2.1 patch
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated async-cache@1.1.0: No longer maintained. Use [lru-cache](http://npm.im/lru-cache) version 7.6 or higher, and provide an asynchronous `fetchMethod` option.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     '/Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/msgpackr-extract',
npm WARN cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/msgpackr-extract'] {
npm WARN cleanup       errno: -66,
npm WARN cleanup       code: 'ENOTEMPTY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: '/Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/msgpackr-extract'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     '/Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/sharp',
npm WARN cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/sharp'] {
npm WARN cleanup       errno: -66,
npm WARN cleanup       code: 'ENOTEMPTY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: '/Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/sharp'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     '/Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/sharp',
npm WARN cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/sharp'] {
npm WARN cleanup       errno: -66,
npm WARN cleanup       code: 'ENOTEMPTY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: '/Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/sharp'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path /Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! The chromium binary is not available for arm64.
npm ERR! If you are on Ubuntu, you can install with: 
npm ERR! 
npm ERR!  sudo apt install chromium
npm ERR! 
npm ERR! 
npm ERR!  sudo apt install chromium-browser
npm ERR! 
npm ERR! /Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:115
npm ERR!                     throw new Error();
npm ERR!                     ^
npm ERR! 
npm ERR! Error
npm ERR!     at /Users/maxdenhoed/Documents/1. Projects/GoReach/website2/gatsby-ecommerce-theme/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:115:27
npm ERR!     at FSReqCallback.oncomplete (node:fs:207:21)
npm ERR! 
npm ERR! Node.js v18.13.0

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/maxdenhoed/.npm/_logs/2023-01-07T08_56_09_427Z-debug-0.log

My two cents: It looks like there was an error while trying to install the sharp and msgpackr-extract packages, which may be causing issues with your npm package installation. The error message mentions that the directories for these packages could not be removed because they were not empty.

One potential cause for this error could be that these directories were not properly cleaned up during a previous installation attempt, and there are still files present in them. Another possibility is that some processes or programs may be holding onto files in these directories, preventing them from being deleted. Please help

As you said, some processes prevent the cleanup. Most likely Chromedriver or Chrome in this case.

I would close them manually via the command line and redo the installation. As you're on Mac, maybe something like:

killall chromedriver
killall chromium

might be enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM