Error errno 4058

I'm trying to install Grunt on my project. It used to work perfectly, but now for some reason, it does not. Every time i try to install Grunt, I got this error: npm ERR! path C:irreleventpathp...

I’m trying to install Grunt on my project. It used to work perfectly, but now for some reason, it does not. Every time i try to install Grunt, I got this error:

npm ERR! path C:irreleventpathprojectnode_modulesansi-styles
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:irreleventpathprojectnode_modulesansi-styles' -> 'C:irreleventpathproject.ansi-styles.DELETE'
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:UsersMeAppDataRoamingnpm-cache_logs2018-04-03T00_52_10_105Z-debug.log

The weird thing is that the missing package change every time.
I try verifying the cache, removing the node_modules folder, cleaning the cache using --force. Uninstall NPM and NodeJS, restart my computer. No chances.
I had to format my computer for security reason, I took the project folder but not the Roaming folder, I don’t know if this had an impact, but it shouldn’t since I reinstalled NPM.

I’m not sure if this will help but here is my package.json

{
 "name": "project",
 "version": "2.1.0",
 "repository": "project-2.0",
 "devDependencies": {
   "grunt": "^1.0.2",
   "grunt-cli": "^1.2.0",
   "grunt-contrib-concat": "~1.0.1",
   "grunt-contrib-copy": "^1.0.0",
   "grunt-contrib-cssmin": "~2.0.0",
   "grunt-contrib-jshint": "~1.1.0",
   "grunt-contrib-uglify": "~2.2.0",
   "grunt-contrib-watch": "~1.0.0",
   "grunt-html-build": "^0.7.1",
   "grunt-real-favicon": "^0.2.2"
 },
 "dependencies": {
   "angular-bootstrap-colorpicker": "^3.0.31",
   "angularjs-geolocation": "^0.1.3",
   "sprintf-js": "^1.1.1"
 }
}

@ronny-springer

I try to install tagged releases from github while using npm install task and I got mostly issues like following lines.

$ npm install -d --save https://github.com/Modernizr/Modernizr/archive/v2.8.3.tar.gz
npm info it worked if it ends with ok
npm info using npm@2.5.1
npm info using node@v1.2.0
npm info retry fetch attempt 1 at 15:27:50
npm info attempt registry request try #1 at 15:27:50
npm http fetch GET https://github.com/Modernizr/Modernizr/archive/v2.8.3.tar.gz
npm http fetch 200 https://github.com/Modernizr/Modernizr/archive/v2.8.3.tar.gz
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\Program Files\iojs\node.exe" "c:\Program Files\iojs\node_modules\npm\bin\npm-cli.js" "install" "-d" "--save" "https://gi
npm ERR! node v1.2.0
npm ERR! npm  v2.5.1
npm ERR! path C:UsersRSPRIN~1.CANAppDataLocalTempnpm-7396-943a15a3unpack-ddc9b881466apackage.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open 'C:UsersRSPRIN~1.CANAppDataLocalTempnpm-7396-943a15a3unpack-ddc9b881466apackage.jso
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:checkoutprojectsCumulusCJCAppswebclientcwc-webnpm-debug.log
/c/Program Files/iojs/npm: line 14:  8540 Signal 112              (core dumped) "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@"

Other sintaxis like npm install -d --save @Modernizr/Modernizr:@2.8.3 or
npm install https://github.com/Modernizr/Modernizr/tarball/v2.8.3 also not working.

Can somebody explain and fix this issue? Is there a workaround for this?
Best,
Ronn

@smikes

This looks like a crash in iojs: /c/Program Files/iojs/npm: line 14: 8540 Signal 112 (core dumped)

However, in this case there is an additional problem: the tarball you are trying to install (Modernizr 2.8.3) does not contain a package.json. npm requires a package.json, so npm cannot install that version of Modernizr.

@othiym23

Yes. npm can only install GitHub repositories that are valid npm packages, and this means that they contain a package.json.

Closing as resolved.

@ronak11

@smikes
i am new for nod.js
i install it for Ghost bloging platform but i have a error
#4058
untitled-5

@KenanY

@ronak11 It looks to me like you are not in the directory where you downloaded Ghost. When you run npm start, there must be a package.json in your current working directory, otherwise npm will have no idea what you want it to do.

If you have any further issues, it would be best to open a new ticket.

@ronak11

@KenanY
Both Ghost and node js in C: directory .i have no idea about Ghost and Node js .
so can you tell me step by step.
Thanks

@KenanY

@ronak11 You should cd into Ghost’s directory, then follow Ghost’s quick install guide from step 4. If you need further help with Ghost, it would be best if you ask on a forum/mailing list/chat room where other Ghost users hang around.

Содержание

  1. npm install error 4058, can’t install private module in windows #12389
  2. Comments
  3. Footer
  4. When I am trying to create my own create-react-app, it’s showing this error #4058
  5. Comments
  6. Footer
  7. npm5 local install with shrinkwrap yields ENOENT -4058 #16601
  8. Comments
  9. I’m opening this issue because:
  10. What’s going wrong?
  11. How can the CLI team reproduce the problem?
  12. supporting information:
  13. Error: ‘npm install -g @ionic/cli’ gives me ‘4 high severity vulnerabilities’ & ‘ERR! errno -4058’
  14. Common errors
  15. AppDataRoamingnpm’ on Windows 7 permalink» >

npm install error 4058, can’t install private module in windows #12389

I can’t install my private module call storage:0.1.1 when I command «npm install» in the root path

I write package.json to install this module as:

and I also write package.json in the private module stroage already, it’s work on my linux well, on windows well before, but one day I install occur error -4058

and there are error message:

ps: I have tried to use powershell with administration and I checked the path ‘C:Usersvincent_linAppDataRoamingnpm-cachestorage.1.1package.tgz’ is correct.
and I ever update npm to latest version, it still exist error.

Thanks for any response.

The text was updated successfully, but these errors were encountered:

Can you provide the entire npm-debug.log as a gist?

We’re closing this issue as it has gone thirty days without activity. In our experience if an issue has gone thirty days without any activity then it’s unlikely to be addressed. In the case of bug reports, often the underlying issue will be addressed but finding related issues is quite difficult and often incomplete.

If this was a bug report and it is still relevant then we encourage you to open it again as a new issue. If this was a feature request then you should feel free to open it again, or even better open a PR.

For more information about our new issue aging policies and why we’ve instituted them please see our blog post.

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

When I am trying to create my own create-react-app, it’s showing this error #4058

PS D:reactjsreactappdemo> npx create-react-app my-app
npm ERR! code ENOLOCAL
npm ERR! Could not install from «PCAppDataRoamingnpm-cache_npx6284» as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersLENOVO PCAppDataRoamingnpm-cache_logs2018-02-22T04_57_10_224Z-debug.log
Install for prefix@latest failed with code 1
npm ERR! code ENOLOCAL
npm ERR! Could not install from «PCAppDataRoamingnpm-cache_npx7448» as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersLENOVO PCAppDataRoamingnpm-cache_logs2018-02-22T04_57_13_468Z-debug.log
Install for create-react-app@latest failed with code 1

The text was updated successfully, but these errors were encountered:

This is an issue with npx . Your computer name has a space in it. See this issue in the npx repo for more info. It is unresolved, unfortunately. I’d recommend npm install -g create-react-app to get around the npx issue.

Please watch zkat/npx#146, there’s nothing we can do here.

I have the same issue of create-react-app failing.
The first few times tried it, the create-react-app my-app worked, but since then, it has refused to work, so I’m virtually stuck with only one React app on my pc.
The npm install -g create-react-app works well, but the create-react-app doesn’t work anymore

This looks like a npx issue, since npm install -g worked, can you run create-react-app directory, ie create-react-app foo insteead of prefixing with npx .

Alternatively does it work if you do a deep copy that react app in a new directory?
All you need is package.json and in fact the react-scripts dependency.

I had the same issue, and I did input this

$ npx create-react-app example1

I have faced these error I update to my npm.
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’
npm ERR! < [Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’]
npm ERR! stack:
npm ERR! ‘Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules»,
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: ‘access’,
npm ERR! path: ‘/usr/local/lib/node_modules’ >
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR! /home/hafiz/.npm/_logs/2018-09-17T12_16_47_034Z-debug.log

@ahsan-asif depending on how you installed node / npm it might require sudo

Please open a new issue if you encounter any problems with Create React App and not npm itself, thanks!

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

npm5 local install with shrinkwrap yields ENOENT -4058 #16601

I’m opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don’t understand.
  • Other (see below for feature requests):

What’s going wrong?

When attempting to install a local, shrinkwrapped package, npm5 throws ENOENT -4058.

How can the CLI team reproduce the problem?

  1. md npm5-test && cd npm5-test
  2. npm5 init -y
  3. npm5 i del
  4. npm5 shrinkwrap — no problem occurs if the shrinkwrap step is omitted
  5. cd..
  6. md npm5-test2 && cd npm5-test2
  7. npm5 init -y
  8. npm5 i ../npm5-test

supporting information:

  • npm5 -v prints: 5.0.0-beta.46
  • node -v prints: v7.10.0
  • npm5 config get registry prints: https://connectionseducation.pkgs.visualstudio.com/_packaging/ConnectionsEducationNpm/npm/registry/
  • Windows, OS X/macOS, or Linux?: Windows 7 64-bit
  • Network issues:
    • Geographic location where npm was run:
    • I use a proxy to connect to the npm registry.
    • I use a proxy to connect to the web.
    • I use a proxy when downloading Git repos.
    • I access the npm registry via a VPN
    • I don’t use a proxy, but have limited or unreliable internet access.
  • Container:
    • I develop using Vagrant on Windows.
    • I develop using Vagrant on OS X or Linux.
    • I develop / deploy using Docker.
    • I deploy to a PaaS (Triton, Heroku).

The text was updated successfully, but these errors were encountered:

I frequently test and integrate packages in products locally before issuing a beta or actual release. Previously, this adjusted set of steps (with —save for install and different folder and command names) worked successfully with npm@4.6.1 and earlier:

  1. md npm-test && cd npm-test
  2. npm init -y
  3. npm i —save del
  4. npm shrinkwrap
  5. cd..
  6. md npm-test2 && cd npm-test2
  7. npm init -y
  8. npm i ../npm-test

Could you upload the npm-debug.log as a plaintext file to https://gist.github.com/ and post a link to it here?

Hi @legodude17, it may have gotten lost a bit in the post above, but there’s a link. Here it is again:

Please let me know if you need anything else.

Narrowing the scope a bit here: The error is only apparent when shrinkwrap is used. Otherwise, the install is clean.

Hmm. That is odd.

@legodude17 et alii, are you able to reproduce the issue with my steps?

I understand that beta.47 and 48 were not targeting this, so this is just in the spirit of keeping the issue updated and verified with latest versions. The same failure still occurs with the latest beta, 48.

@simonua thanks for the update. I’m starting to poke at this one but I suspect other work that’s going on wrt local directory deps is going to take care of this pretty soon 🙂

You’re welcome, @zkat. Thank you very much! I’ll stay tuned.

Just to keep this fresh, this is reproducible with beta53 as well.

Stuff with local packages hasn’t been fixed yet, and I don’t know if I can give you a timeline before «May 30th, when we’re out of beta», but it’s definitely on our list of pre-release requirements.

@zkat, no worries at all here. Thanks for all the great work! =)

@simonua this should be fixed in npm@5.0.0 . Could you confirm that your non-minimal test was fixed as well?

Hi @zkat, I’m sorry, but I can’t get it to work yet with these steps and npm@5.0.0.
Here’s a new gist.

  1. md npm-test && cd npm-test
  2. npm init -y
  3. npm i del
  4. npm shrinkwrap
  5. cd..
  6. md npm-test2 && cd npm-test2
  7. npm init -y
  8. npm i ../npm-test

Sorry to keep you trying this. We’ll take a look at this again, I guess 🙃

Not a problem at all! Thank you very much flr

Thank you very much for following up.

@zkat, sooo. using an absolute instead of a relative path in the last step works with npmc 5.0.4-canary.2 (and presumably earlier versions). In my case, that was running npmc i c:devnpm-test instead of npmc i ../npm-test .

To be clear in case the seriousness of this issue isn’t obvious, this happens all the time once you upgrade to Node 8.x (npm 5.x ) where shrinkwrapping (via package-lock.json ) happens by default.

I see a number of strange things around this:

  1. package-lock.json always keeps referring to local file-paths even after I update package.json to switch back to a published version of the package.
  2. Even if I delete the package-lock.json to get rid of the association with the local file-path, NPM somehow still knows about the association since it ENOENT errors about files at the local file-path that it no longer has any business knowing about (guess there must be a global cache like what Yarn has?).
  3. After deleting the package-lock.json file the first install gives me some ENOENT errors, the second install gives me some SKIPPING OPTIONAL DEPENDENCY: ENOENT errors, whereas by the third install then everything finally works without any errors at all!

Thanks for you continued hard work getting these NPM5 regressions fixed! ❤️

Источник

Error: ‘npm install -g @ionic/cli’ gives me ‘4 high severity vulnerabilities’ & ‘ERR! errno -4058’

I get this message ‘4 high severity vulnerabilities’ after running the command ‘npm install -g @ionic/cli’ on Windows 10. When I do the subsequent ‘ionic start’ command I get warning messages and the execution hangs.

Details:

Computer OS: Windows 10

Installed everything from: node-v16.13.0-x64.msi and this gave me:
node Version 16.13.0, and
npm Version 8.1.0

‘npm install -g @ionic/cli’ gave this message:
.
4 high severity vulnerabilities
.

(a) npm audit gave:
.
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i —package-lock-only
.
(b) npm i —package-lock-only gave:
.
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open ‘F:ProjectsIonicpackage.json’
.

When I tried the ‘npm audit fix —force’ it was unsuccessful for I got more errors, Example:
npm WARN using —force Recommended protections disabled.
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
.

Examples of error messages that occur after executing ‘ionic start’:
.
npm.cmd i —save -E @capacitor/core@latest
npm WARN EBADENGINE Unsupported engine <
npm WARN EBADENGINE package: ‘@angular-devkit/build-angular@12.1.4’,
npm WARN EBADENGINE required: <
npm WARN EBADENGINE node: ‘^12.14.1 || >=14.0.0’,
npm WARN EBADENGINE npm: ‘^6.11.0 || ^7.5.6’,
npm WARN EBADENGINE yarn: ‘>= 1.13.0’
npm WARN EBADENGINE >,
npm WARN EBADENGINE current: < node: ‘v16.13.0’, npm: ‘8.1.0’ >
npm WARN EBADENGINE >
.
Eventually ends up hanging also.

Any help would be appreciated to fix this problem I am facing.

Источник

Common errors

Broken npm installation

If your npm is broken:

  • On Mac or Linux, reinstall npm.
  • Windows: If you’re on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version).
  • Some strange issues can be resolved by simply running npm cache clean and trying again.
  • If you are having trouble with npm install , use the -verbose option to see more details.

No compatible version found

AppDataRoamingnpm’ on Windows 7 permalink» >

Error: ENOENT, stat ‘C:Users AppDataRoamingnpm’ on Windows 7

The error Error: ENOENT, stat ‘C:Users AppDataRoamingnpm’ on Windows 7 is a consequence of joyent/node#8141, and is an issue with the Node installer for Windows. The workaround is to ensure that C:Users AppDataRoamingnpm exists and is writable with your normal user account.

You are trying to install on a drive that either has no space, or has no permission to write.

  • Free some disk space or
  • Set the tmp folder somewhere with more space: npm config set tmp /path/to/big/drive/tmp or
  • Build Node yourself and install it somewhere writable with lots of space.

You need to install git. Or, you may need to add your git information to your npm profile. You can do this from the command line or the website. For more information, see «Managing your profile settings».

Running a Vagrant box on Windows fails due to path length issues

@drmyersii went through what sounds like a lot of painful trial and error to come up with a working solution involving Windows long paths and some custom Vagrant configuration:

In the code above, I am appending \? to the current directory absolute path. This will actually force the Windows API to allow an increase in the MAX_PATH variable (normally capped at 260). Read more about max path. This is happening during the sharedfolder creation which is intentionally handled by VBoxManage and not Vagrant’s «synced_folder» method. The last bit is pretty self-explanatory; we create the new shared folder and then make sure it’s mounted each time the machine is accessed or touched since Vagrant likes to reload its mounts/shared folders on each load.

npm only uses git: and ssh+git: URLs for GitHub repos, breaking proxies

I fixed this issue for several of my colleagues by running the following two commands:

One thing we noticed is that the .gitconfig used is not always the one expected so if you are on a machine that modified the home path to a shared drive, you need to ensure that your .gitconfig is the same on both your shared drive and in c:users[your user]

You are trying to talk SSL to an unencrypted endpoint. More often than not, this is due to a proxy configuration error (see also this helpful, if dated, guide). In this case, you do not want to disable strict-ssl – you may need to set up a CA / CA file for use with your proxy, but it’s much better to take the time to figure that out than disabling SSL protection.

This problem will happen if you’re running Node 0.6. Please upgrade to node 0.8 or above. See this post for details.

You could also try these workarounds: npm config set ca «» or npm config set strict-ssl false

  • upgrade your version of npm npm install npm -g —ca=»»
  • tell your current version of npm to use known registrars npm config set ca=»»

If this does not fix the problem, then you may have an SSL-intercepting proxy. (For example, https://github.com/npm/npm/issues/7439#issuecomment-76024878)

Not found / Server error

  • It’s most likely a temporary npm registry glitch. Check npm server status and try again later.
  • If the error persists, perhaps the published package is corrupt. Contact the package owner and have them publish a new version of the package.
  • Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later.
  • This can be caused by corporate proxies that give HTML responses to package.json requests. Check npm’s proxy configuration.
  • Check that it’s not a problem with a package you’re trying to install (e.g. invalid package.json ).

Many ENOENT / ENOTEMPTY errors in output

npm is written to use resources efficiently on install, and part of this is that it tries to do as many things concurrently as is practical. Sometimes this results in race conditions and other synchronization issues. As of npm 2.0.0, a very large number of these issues were addressed. If you see ENOENT lstat , ENOENT chmod , ENOTEMPTY unlink , or something similar in your log output, try updating npm to the latest version. If the problem persists, look at npm/npm#6043 and see if somebody has already discussed your issue.

cb() never called! when using shrinkwrapped dependencies

Take a look at issue #5920. We’re working on fixing this one, but it’s a fairly subtle race condition and it’s taking us a little time. You might try moving your npm-shrinkwrap.json file out of the way until we have this fixed. This has been fixed in versions of npm newer than npm@2.1.5 , so update to npm@latest .

npm login errors

Sometimes npm login fails for no obvious reason. The first thing to do is to log in at https://www.npmjs.com/login and check that your e-mail address on npmjs.com matches the email address you are giving to npm login .

If that’s not the problem, or if you are seeing the message «may not mix password_sha and pbkdf2» , then

  1. Log in at https://npmjs.com/
  2. Change password at https://npmjs.com/password – you can even «change» it to the same password
  3. Clear login-related fields from

/.npmrc – e.g., by running sed -ie ‘/registry.npmjs.org/d’

and it generally seems to work.

npm hangs on Windows at addRemoteTarball

Check if you have two temp directories set in your .npmrc :

Look for lines defining the tmp config variable. If you find more than one, remove all but one of them.

See https://github.com/npm/npm/issues/7590 for more about this unusual problem.

npm not running the latest version on a Windows machine

Источник

Introduction

Recently, I’ve faced different issues when tryng npm install in some of the project I’ve been working with.

Environment

  • Windows 10 (OS Build 15063.413)
  • Node version: 8.1.2
  • NPM version: 5.0.3

Every time I tried npm install or install a isolated package I got errors like this one:
ENOENT 4058

Problem

1
2
3
4
5
6
7
_npm ERR! path GitHubreact-typescript-webpack2-cssModules-postCSSnode_modulests-loader
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'D:GitHubreact-typescript-webpack2-cssModules-postCSSnode_m
odulests-loader' -> 'GitHubreact-typescript-webpack2-cssModules-postCSSnode_modules.ts-loader.DELETE'
npm ERR! enoent This is related to npm not being able to find a file._

Solution

The solution for my specific scenario was:

1. Close VS Code
2. Remove package-lock.json, node_modules and npm cache

1
2
3
4

del package-lock.json
rd /s /q node_modules
npm cache clear --force
1
2
3
4

rm package-lock.json
rm -rf node_modules/
npm cache clear --force

3. Retry npm i

Read more…

If you still have this problem, read this: https://github.com/npm/npm/issues/10826

Copyright Notice: All articles in this blog are licensed under CC BY-SA 4.0 unless stating additionally.

Question

When I set the Vue project to automatically jump to the browser after startup, the console reports the following errors:

DONE  Compiled successfully in 11178ms                                                                      下午3:42:04


  App running at:
  - Local:   http://localhost:8080/
  - Network: unavailable

  Note that the development build is not optimized.
  To create a production build, run npm run build.

events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:8080/' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:nodenode_cache_logs2020-12-19T07_42_04_693Z-debug.log

When I don’t set "serve": "Vue cli Service -- Open", it can run normally without any error. According to the error prompt spawn CMD enoent, we can know

spawn XXX enoent: indicates that the environment variable of the corresponding running program is missing. The reason for the error is that the computer lacks the environment variable of the CMD running program. I think the error is probably because to realize automatic jump, you need to enter a command in CMD and then the computer system calls the browser, but the computer lacks the environment variable of the CMD running program, so the error is reported (comments are welcome)

Solution:

Add C:windowssystem32 to the environment variable path

Right click my computer (this computer) – properties – advanced system settings (search) – Advanced – environment variables – system variables, find path and add it
after adding, close vscode and reopen the startup project

Read More:

#npm

Вопрос:

Я уже довольно давно пытаюсь это исправить, но безрезультатно. Сначала я изменяю путь к переменной окружения своей системы на system32. Я очистил кэш npm, затем удалил модули package.json и node и все равно не работал. Я был бы признателен, если бы кто-нибудь мог помочь мне в этом

 events.js:377
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:WindowsSystem32WindowsPowerShellv1.0powershell ENOENT    
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:467:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)      Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:467:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {      errno: -4058,   code: 'ENOENT',   syscall: 'spawn C:WindowsSystem32WindowsPowerShellv1.0powershell',   path: 'C:WindowsSystem32WindowsPowerShellv1.0powershell',   spawnargs: [
    '-NoProfile',
    '-NonInteractive',
    '–ExecutionPolicy',
    'Bypass',
    '-EncodedCommand',
    'UwB0AGEAcgB0ACAAIgBoAHQAdABwADoALwAvAGwAbwBjAGEAbABoAG8AcwB0ADoAMwAwADAAMAAiAA==' ] } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! (project name)@0.1.0 start: `react-scripts start` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the (project name)@0.1.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR!
 

Недавно я начал новый проект на Angular, и для этого мне нужно было установить пакеты в моем файле package.json. Файл package.json — это тот, который вы получаете от ‘ng new’. Я бесчисленное количество раз пытался заставить это работать, но постоянно получаю один и тот же результат на обоих моих компьютерах, и я понятия не имею, почему. Я потратил на это несколько часов, но не собираюсь сдаваться. Есть ли у кого-нибудь идеи, почему это происходит? Подробности я предоставлю ниже.

Подробности:

  • Запуск ‘npm -v’ дает мне: 5.6.0
  • запуск ‘node -v’ дает мне: v8.10.0
  • Я уже успешно выполнил npm i -g @ angular / cli

Проблема:

  • Я пытаюсь запустить npm install, какое-то время она выполняется, затем появляется следующая ошибка:

    Npm ERR! enoent ENOENT: нет такого файла или каталога, переименуйте ‘D: Project FrontEnd node_modules @ angular-devkit build-optimizer node_modules typescript’ -> ‘D: Project FrontEnd node_modules @ angular-devkit оптимизатор сборки node_modules.typescript.DELETE ‘

Что я уже пробовал:

  • Удаление nodejs, переустановка, npm i -g @ angular / cli, npm i (бесполезно)
  • Выполнение npm i несколько раз (я читал о возможных условиях гонки) (бесполезно)
  • Пытался сделать то, что говорилось в ошибке (файл на самом деле не существует) (бесполезно)
  • Пытался начать еще один новый проект с нуля (ничего не вышло)
  • Пробовал ‘npm uninstall -g @ angular / cli’, ‘npm cache clear —force’, ‘npm install -g @ angular / cli’, ‘npm install’ (бесполезно)
  • И напоследок попробовал гайд здесь

Я уже в отчаянии, потому что понятия не имею, что делаю не так. (У меня это работало раньше !!) Любой совет был бы полезен. ЛЮБОЙ. И снова файл package.json создается командой ng new, но при необходимости я могу разместить его здесь.
(И прежде чем кто-нибудь спросит, это не потому, что он находится на диске D: /, он делает то же самое на диске C: /.)

Package.json:

{
  "name": "my-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "~1.7.3",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}

When I was running “npm install -g angular-cli”, I was getting the following error:

npm ERR! npm  v3.10.3                                                 

npm ERR! path C:UsersRoelAppDataRoamingnpmnode_modules.staginga

bbrev-69492d5e                                                        

npm ERR! code ENOENT                                                  

npm ERR! errno -4058                                                  

npm ERR! syscall rename                                               

npm ERR! enoent ENOENT: no such file or directory, rename ‘C:UsersRoe

lAppDataRoamingnpmnode_modules.stagingabbrev-69492d5e’ -> ‘C:Use

rsRoelAppDataRoamingnpmnode_modulesangular-clinode_modulesember

-clinode_modulesnpmnode_modulesabbrev’                            

npm ERR! enoent ENOENT: no such file or directory, rename ‘C:UsersRoe

lAppDataRoamingnpmnode_modules.stagingabbrev-69492d5e’ -> ‘C:Use

rsRoelAppDataRoamingnpmnode_modulesangular-clinode_modulesember

-clinode_modulesnpmnode_modulesabbrev’                            

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:devangular2npm-debug.log                            

npm ERR! code 1

My environment consisted of:

  • windows 10 64 bit
  • node v6.4.0
  • npm v3.10.3

This problem was also solved by @davidrensh solution:

npm uninstall -g angular-cli

npm install -g angular-cli

From <https://github.com/angular/angular-cli/issues/1190>

Tags: Angular, CLI

Понравилась статья? Поделить с друзьями:
  • Error enoent no such file or directory scandir
  • Error enoent no such file or directory open etc ksc web console setup json
  • Error enoent no such file or directory lstat index pug
  • Error english cover
  • Error endl was not declared in this scope