无法在 Mac 上使用 NPM 安装新程序

时间:2021-06-17 13:52:44

标签: node.js macos npm gulp

我正在尝试使用浏览器同步、gulp 和 gulp-sass 设置一个新的节点项目,但不断收到大量错误。我完全卸载了 Node 和 NPM,然后重新安装它们没有效果。

当我提供以下终端命令时:

npm install browser-sync gulp gulp-sass --save-de

结果如下:

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /Users/josephfrye/Documents/Code/Project/node_modules/gulp-sass/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/install.js
npm ERR! node:internal/modules/cjs/loader:944
npm ERR!   throw err;
npm ERR!   ^
npm ERR! 
npm ERR! Error: Cannot find module 'mkdirp'
npm ERR! Require stack:
npm ERR! - /Users/josephfrye/Documents/Code/Project/node_modules/gulp-sass/node_modules/node-sass/scripts/install.js
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:774:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1013:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:93:18)
npm ERR!     at Object.<anonymous> (/Users/josephfrye/Documents/Code/Project/node_modules/gulp-sass/node_modules/node-sass/scripts/install.js:7:11)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1109:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:989:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:829:14)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     '/Users/josephfrye/Documents/Code/Project/node_modules/gulp-sass/node_modules/node-sass/scripts/install.js'
npm ERR!   ]
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/josephfrye/.npm/_logs/2021-06-16T21_19_01_116Z-debug.log
josephfrye@JosephFryesiMac Project % npm cache clean
npm ERR! As of npm@5, the npm cache self-heals from corruption issues
npm ERR! by treating integrity mismatches as cache misses.  As a result,
npm ERR! data extracted from the cache is guaranteed to be valid.  If you
npm ERR! want to make sure everything is consistent, use `npm cache verify`
npm ERR! instead.  Deleting the cache can only make npm go slower, and is
npm ERR! not likely to correct any problems you may be encountering!
npm ERR! 
npm ERR! On the other hand, if you're debugging an issue with the installer,
npm ERR! or race conditions that depend on the timing of writing to an empty
npm ERR! cache, you can use `npm install --cache /tmp/empty-cache` to use a
npm ERR! temporary cache instead of nuking the actual one.
npm ERR! 
npm ERR! If you're sure you want to delete the entire cache, rerun this command
npm ERR! with --force.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/josephfrye/.npm/_logs/2021-06-16T21_28_58_342Z-debug.log
=> If you wish to uninstall them at a later point (or re-install them under your
=> `nvm` Nodes), you can remove them from the system Node as follows:

     $ nvm use system
     $ npm uninstall -g a_module

有什么想法吗?

0 个答案:

没有答案
相关问题