question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

run 'vue init webpack' fail in windows10

See original GitHub issue

node version is v8.9.1 npm version is 5.5.1 vue-cli version is 2.9.2

if i initialize a vue project like:

vue init webpack testproject

and follow the prompts to configure, then it show err:

? Project name test
? Project description A Vue.js project
? Author
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) npm

   vue-cli · Generated "test".


# Installing project dependencies ...
# ========================


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

Error: spawn npm ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
litong534commented, Dec 13, 2017

you can choose ‘NO, I will handle that myself’ as a workaround

1reaction
lambdakriscommented, Dec 14, 2017

There is also an issue in the npm repo https://github.com/npm/npm/issues/19374 about the same thing.

The issue is that when you provide a name to create a directory, like so

vue init webpack myproject
...

Instead of using the current directory, like so

mkdir myproject
cd myproject
vue init webpack
...

When you then elect to have scaffolding restore your packages (whether through npm or yarn), you are not in the project directory, but above it, so the package install/restore command fails. The workaround works because it skips the package install/restore command. The fix (if you like) would be for vue-cli to change into the directory that it created (when a name is provided) before running the package install/restore command.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue init webpack test - not creating project - strict mode error?
Unfortunatly, "test" directory is not created. I am using Bash on Ubuntu on Windows 10 and the following NPM packages: vue@2.5.2; vue-cli@2.9.
Read more >
Installation | webpack
This guide goes through the various methods used to install webpack. Prerequisites. Before we begin, make sure you have a fresh version of...
Read more >
Creating a Project | Vue CLI
vuerc . The vue create command has a number of options and you can explore them all by running: vue create --help.
Read more >
webpack-cli - npm
Start using webpack-cli in your project by running `npm i webpack-cli`. ... --fail-on-warnings Stop webpack-cli process with non-zero exit ...
Read more >
Websdk 2.5.0 not work in vue 2 - Web - Zoom Developer Forum
Description develop with vue 2 (vue init webpack my-project) ,fail to complie Browser ... import websdk to app.vue; npm run dev; see error....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found