npm ERR!Windows_NT 6.1.7601:ENOENT:没有这样的文件或目录 [英] npm ERR! Windows_NT 6.1.7601: ENOENT: no such file or directory
问题描述
因此,我刚刚创建了新的Angular应用程序,每当我通过右键单击package.json文件并选择 Restore Packages
选项还原包时,都会在下面显示这些npm错误.我该如何解决?
So I just created my new Angular application and whenever I restore my packages by right-clicking package.json file and selecting Restore Packages
option, I get these npm errors below. How do I resolve them?
我看过此链接 Npm错误-Windows NT-如何解决,但提供的解决方案基于用户的特定操作系统注册表信息.
I had a look at this link Npm Error - Windows NT - How to resolve but the solutions provided are based on the user's specific OS registry information.
我正在使用64位操作系统.运行VS 2015 Update3.我安装了Node JS,并运行以下命令确认了这一点:
I'm using a 64-bit OS. Running VS 2015 Update 3. I have Node JS installed and running the following commands confirms this:
-
节点-v:
v6.10.3
npm -v:
v3.10.10
不相关的第三项检查:
- 已安装TypeScript并且VS正在运行 2.3.3.0
npm ERR!Windows_NT 6.1.7601npm ERR!argv"C:\ Program Files \ nodejs \ node.exe""C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js"安装"npm ERR!节点v6.10.3npm ERR!npm v3.10.10npm ERR!路径C:\ Users \ Linda \ Angular2Test \ Angular2Test \ Angular2Test \ node_modules.staging \ source-map-support-b3871625npm ERR!代码ENOENTnpm ERR!埃尔诺-4058npm ERR!syscall重命名npm ERR!enoent ENOENT:没有这样的文件或目录,重命名为'C:\ Users \ Linda \ Angular2Test \ Angular2Test \ Angular2Test \ node_modules.staging \ source-map-support-b3871625'->'C:\ Users \ Linda \ Angular2Test \ Angular2Test \Angular2Test \ node_modules \ source-map-support'npm ERR!enoent ENOENT:没有此类文件或目录,请重命名'C:\ Users \ User \ Angular2Test \ Angular2Test \ Angular2Test \ node_modules.staging \ source-map-support-b3871625'->'C:\ Users \ User \ Angular2Test \ Angular2Test \Angular2Test \ node_modules \ source-map-support'npm ERR!enoent这很可能不是npm本身的问题npm ERR!enoent,并且与npm无法找到文件有关.npm ERR!天生的npm ERR!请在任何支持请求中包括以下文件:npm ERR!C:\ Users \ Linda \ Angular2Test \ Angular2Test \ Angular2Test \ npm-debug.logangular-quickstart@1.0.0 C:\ Users \ User \ Angular2Test \ Angular2Test \ Angular2Test
npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v6.10.3 npm ERR! npm v3.10.10 npm ERR! path C:\Users\Linda\Angular2Test\Angular2Test\Angular2Test\node_modules.staging\source-map-support-b3871625 npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall rename npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Linda\Angular2Test\Angular2Test\Angular2Test\node_modules.staging\source-map-support-b3871625' -> 'C:\Users\Linda\Angular2Test\Angular2Test\Angular2Test\node_modules\source-map-support' npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules.staging\source-map-support-b3871625' -> 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules\source-map-support' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent npm ERR! Please include the following file with any support request: npm ERR! C:\Users\Linda\Angular2Test\Angular2Test\Angular2Test\npm-debug.log angular-quickstart@1.0.0 C:\Users\User\Angular2Test\Angular2Test\Angular2Test
经过无法npm安装我的软件包之后,以下是我做了检查:
After going over Unable to npm install my package here are the following checks I did:
-
我有一个package.json文件,并且没有拼错.
I have a package.json file and it is not misspelled.
我检查了我的devDependencies,package.json文件运行的版本似乎是 1.0.0 (通过lite服务器运行)
I checked my devDependencies and the version that package.json file is running on seems to be 1.0.0 (run on via the lite server)
这是我的package.json文件的devDependencies:
Here is my devDependencies of my package.json file:
"devDependencies":{"concurrently":"^ 3.2.0","lite-server":"^ 2.2.2","typescript":〜2.1.0",
"devDependencies": { "concurrently": "^3.2.0", "lite-server": "^2.2.2", "typescript": "~2.1.0",
"canonical-path": "0.0.2",
"tslint": "^3.15.1",
"lodash": "^4.16.4",
"jasmine-core": "~2.4.1",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~4.0.14",
"rimraf": "^2.5.4",
"@types/node": "^6.0.46",
"@types/jasmine": "2.5.36"
},
"repository": {}
该错误确实表明这不是npm的问题,但无法找到文件.这是什么文件?
The error does state that this is not a problem with npm but it not being able to find a file. What file is this?
更新:我注意到,根据以下错误, .staging 文件夹在我的项目目录中不存在.
UPDATE: I noticed that the .staging folder is none existent in my project directory as per the below error.
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules\.staging\source-map-support-b3871625' -> 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules\source-map-support'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules\.staging\source-map-support-b3871625' -> 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules\source-map-support'
推荐答案
我只运行了以下命令,错误就消失了.
I simply ran the following command and the error(s) went away.
npm install -g grunt
这篇关于npm ERR!Windows_NT 6.1.7601:ENOENT:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!