NodeJS 运行Npm install时出现NPM ENOENT错误

hvvq6cgz  于 2023-04-05  发布在  Node.js
关注(0)|答案(5)|浏览(369)

我一直在尝试为我的Discord服务器制作一个基于Rover的机器人,但是每当我运行npm Install时,我总是收到ENOENT错误。
我知道还有其他类似的帖子,但没有一个答案有效,而且它们与我遇到的问题不完全相同。我已经尝试重新安装Node.js和NPM,确保package.json在那里,重新启动并以管理员身份运行。我目前运行的是Windows 10版本1903,Node版本12.13.0,npm版本6.12.0。

输出如下:

C:\Users\terri_3irl9af\Desktop\AMC Pilot Management>npm install
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\type-b1627078\array\ensure.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es6-map-8f9402c7\primitive\index.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es6-set-0c58b760\lib\iterator.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\type-b1627078\array\is.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es6-iterator-44858e44\test\array.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es6-set-0c58b760\lib\primitive-iterator.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es6-iterator-44858e44\test\for-of.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es6-iterator-44858e44\test\get.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\inquirer-1bea01d1\lib\utils\events.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es6-iterator-44858e44\test\index.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\inquirer-1bea01d1\lib\utils\paginator.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es6-iterator-44858e44\test\is-iterable.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\inquirer-1bea01d1\lib\utils\readline.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es6-iterator-44858e44\test\string.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\inquirer-1bea01d1\lib\utils\screen-manager.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es6-iterator-44858e44\test\valid-iterable.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\inquirer-1bea01d1\lib\utils\utils.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\readable-stream-cd75c034\lib\internal\streams\BufferList.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\readable-stream-cd75c034\lib\internal\streams\destroy.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\readable-stream-cd75c034\lib\internal\streams\stream-browser.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\readable-stream-cd75c034\lib\internal\streams\stream.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\eslint-9d02902d\lib\util\patterns\letters.js'
npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\eslint-9d02902d\lib\code-path-analysis'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\type-b1627078\test\array-length\coerce.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\type-b1627078\test\array-length\ensure.js'
npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\type-b1627078\test\array-like'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\array\#\map\implement.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\array\#\map\index.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\array\#\map\is-implemented.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\array\#\map\shim.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\array\#\remove.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\array\#\separate.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\copy-within.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\entries.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\every.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\fill.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\filter.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\find-index.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\find.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\flat-map.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\flatten.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\for-each.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\includes.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\index-of.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\index.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\iterator.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\join.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\keys.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\last-index-of.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\map.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\reduce-right.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\reduce.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\slice.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\some.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\sort.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\array\virtual\values.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\asap.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\clear-immediate.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\math\atanh\implement.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\math\atanh\index.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\math\atanh\is-implemented.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\math\atanh\shim.js'
npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\math\cbrt'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\error\index.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\core-js-70848f9b\fn\error\is-error.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\math\log10\implement.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\math\log10\index.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\math\log10\is-implemented.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\math\log10\shim.js'
npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\terri_3irl9af\Desktop\AMC Pilot Management\node_modules\.staging\es5-ext-7d8b429e\math'
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/discordjs/Commando.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\terri_3irl9af\AppData\Roaming\npm-cache\_logs\2019-10-23T23_59_46_552Z-debug.log```
ao218c7q

ao218c7q1#

您的日志底部附近有此错误:

npm ERR! syscall spawn git

这意味着你的机器上没有安装git。你需要从这里安装githttps://git-scm.com/downloads .
我遇到了和你一样的问题,一旦我安装了git,问题就消失了。

kcugc4gi

kcugc4gi2#

听起来有点像是权限问题。你在你项目的根目录吗?
出发地:https://github.com/visionmedia/debug/issues/261
如果你是Node/github/etc的新手,你可能正在做我所做的事情--克隆一个repo,然后忘了cd到repo目录--所以npm找不到package.json文件,所以它会给你一个很大的令人费解的错误消息。
我猜你有一个package.json文件在你运行测试的同一目录下??

watbbzwu

watbbzwu3#

我在使用NextJS的时候也遇到了类似的错误。我解决了这个问题,只是再次运行yarn dev。你应该在安装npm-packages之后再做。

z8dt9xmd

z8dt9xmd4#

试试这个

npx npkill

它会问你是否要安装npkill,然后你应该用空格键删除node_modules。
如果删除了node_modules,请重新安装node_modules

npm i
kknvjkwl

kknvjkwl5#

你已经打开了一些文件的AppData等在vs代码这就是为什么终端提供错误
到vs代码=〉打开文件夹=〉选择项目文件夹,然后vs代码将显示一些已经打开的文件,剪切它们,然后终止

相关问题