【发布时间】:2021-10-18 12:36:00
【问题描述】:
我在 Mac os 最新版本上使用 Visual Studio Code。
当我尝试运行 npm start 时遇到很多错误,我已在此处的单独问题中发布:
https://stackoverflow.com/questions/68795808/unable-to-solve-error-code-1-when-runningnpm-install
当我尝试运行时,我想再次安装所有可能的模块以解决问题:
npm i -g npm
我什至得到错误,其中一部分被复制到这里:
ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/local/lib/node_modules/node/bin/node
/usr/local/lib/node_modules/npm/bin/npm-cli.js install --force --
cache=/Users/afshinshahpari/.npm --prefer-offline=false --prefer-online=false --
offline=false --no-progress --no-save --no-audit --include=dev --include=peer --
include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN old lockfile
npm ERR! npm WARN old lockfile The package-lock.json file was created with an old
version of npm,
npm ERR! npm WARN old lockfile so supplemental metadata must be fetched from the
registry.
npm ERR! npm WARN old lockfile
npm ERR! npm WARN old lockfile This is a one-time fix-up, please be patient...
npm ERR! npm WARN old lockfile
npm ERR! npm WARN deprecated fsevents@1.2.11: fsevents 1 will break on node v14+ and
could be using insecure binaries. Upgrade to fsevents 2.
我尝试使用这篇文章解决此问题:
https://stackoverflow.com/questions/66434750/npm-err-git-dep-preparation-failed-when-trying-to-install-package-json
但是当运行“npm audit fix”时,我得到了一组新的错误:
npm ERR! code ENOLOCK
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i --package-lock-only
npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/afshinshahpari/.npm/_logs/2021-08-16T12_46_15_639Z-debug.log
为了解决它,我使用了
npm i --package-lock-only
但没有成功。
【问题讨论】:
标签: npm