Jiuh star
Jiuh star

Reputation: 13

Vue CLI got error code 4058 when create project

When I create a new Vue project using CLI tools, I got the 4058 error, here's my code:

Vue CLI v4.5.6
? Please pick a preset: Default ([Vue 2] babel, eslint)


Vue CLI v4.5.6
✨  Creating project in D:\PP\Others\StaticBlog\static-blog.
�  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path D:\PP\Others\StaticBlog\static-blog\node_modules\@babel\parser
npm ERR! dest D:\PP\Others\StaticBlog\static-blog\node_modules\@babel\.parser.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'D:\PP\Others\StaticBlog\static-blog\node_modules\@babel\parser' -> 'D:\PP\Others\StaticBlog\static-blog\node_modules\@babel\.parser.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:\Users\Echo\AppData\Roaming\npm-cache\_logs\2020-09-24T04_43_39_501Z-debug.log
 ERROR  command failed: npm install --loglevel error

It seems that some files didn't install correctly, so I delete directories npm and npm_cache to reinstall, but still got the same. Then I tried to install @babel\parser manually, same.

I'm puzzled, please give me some helpful suggestions!

Here's the information that may needed:

OS: Win 7
npm version: 6.14.6
Node.js version: v12.18.4

Upvotes: 1

Views: 867

Answers (2)

Justin
Justin

Reputation: 11

I meet this issue also, and I using "-m yarn" option to create project successfully.

vue create your-project -m yarn

Upvotes: 1

David Ayres
David Ayres

Reputation: 105

I had the same error, finally got it working by installing Yarn and selecting Yarn as my dependency manager in the vue ui project setup (which I had never used before).

Steps I used to fix this issue:

  • If you type "vue ui" in the console (make sure you're in the directory where you want to create the project) you will be presented with the vue ui project setup.
  • I chose "Create Project Here", then chose the manual option and selected what I wanted in the steps following. Also, be sure to choose Yarn as your dependency manager.

This is what finally worked for me, and now my Vue.js project is working properly with Babel, Vue Router, Vuex, etc. I hope this solution works for you as its very frustrating not finding a solution out there yet.

Upvotes: 0

Related Questions