Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue init webpack error · [README.md] Missing helper: "if_or" #627

Closed
memoryleakyu opened this issue Nov 1, 2017 · 9 comments
Closed

vue init webpack error · [README.md] Missing helper: "if_or" #627

memoryleakyu opened this issue Nov 1, 2017 · 9 comments
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author

Comments

@memoryleakyu
Copy link

vue init webpack my-project

? Project name ***
? Project description ***
? Author ***
? Vue build standalone
? Install vue-router? No
? Use ESLint to lint your code? No
? Setup unit tests with Karma + Mocha? No
? Setup e2e tests with Nightwatch? No
vue-cli · [README.md] Missing helper: "if_or"

I tried several times and the error seems to be randomly reported. like this
vue-cli · [package.json] Missing helper: "if_or"

my node version is 8.5.0

a lot appreciate if you could solve this problem

@posva posva added the needs reproduction This issue is missing a minimal runnable reproduction, provided by the author label Nov 1, 2017
@posva
Copy link
Member

posva commented Nov 1, 2017

Could you give more information about your OS? I'm unable to reproduce it on OS X

@memoryleakyu
Copy link
Author

Sorry I forgot to mention it. I'm using it on windows 10 . I also tired it with node v8.9.0. It reported the same error vue-cli · [package.json] Missing helper: "if_or".
I have used vue-cli 2.8.2 before successfully with the same computer and os. Dont know what happened when I updated the vue-cli to 2.9.1

@cocoastorm
Copy link

Hey, are you using yarn or npm?
I encountered a similar issue but it was complaining about Missing helper: "if_eq" ...

@AlwaysHacking
Copy link

I got the exactly same error on my OS X.

@memoryleakyu
Copy link
Author

my problem was solved. try not to name the project.
just use vue init webpack then everything goes well. don't know what's the trick behind it

@LinusBorg
Copy link
Member

OPs problem was solved, reproductions where not provided, issue has been inactive for 7 days.

=> Closing.

@adrienthiery
Copy link

adrienthiery commented Dec 5, 2017

Hey there @LinusBorg ,

Got that error today on MacOSX 10.12.6.

Installing vue-cli with yarn globally threw that error.

$ yarn global add vue-cli                                 ✓  22:09
yarn global v1.3.2
[1/4] 🔍  Resolving packages...
warning vue-cli > coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
warning vue-cli > metalsmith > gray-matter > coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Installed "vue-cli@2.9.2" with binaries:
      - vue
      - vue-init
      - vue-list
✨  Done in 10.69s.

$ vue-init webpack news                                   ✓  22:10

? Project name news
? Project description Show dogshed events
? Author Adrien Thiery
? Vue build standalone
? Install vue-router? No
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Airbnb
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
   vue-cli · [.babelrc] Missing helper: 'if_or'

$ yarn global remove vue-cli                            1 ↵  22:16
yarn global v1.3.2
[1/2] Removing module vue-cli...
[2/2] Regenerating lockfile and installing missing dependencies...
success Uninstalled packages.
✨  Done in 16.09s.

$ npm i -g vue-cli                                        ✓  22:16
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
/Users/osedea/.nvm/versions/node/v8.9.0/bin/vue -> /Users/osedea/.nvm/versions/node/v8.9.0/lib/node_modules/vue-cli/bin/vue
/Users/osedea/.nvm/versions/node/v8.9.0/bin/vue-init -> /Users/osedea/.nvm/versions/node/v8.9.0/lib/node_modules/vue-cli/bin/vue-init
/Users/osedea/.nvm/versions/node/v8.9.0/bin/vue-list -> /Users/osedea/.nvm/versions/node/v8.9.0/lib/node_modules/vue-cli/bin/vue-list
+ vue-cli@2.9.2
added 264 packages in 12.443s

$ vue init webpack news                                   ✓  22:17

? Project name news
? Project description Show dogshed events
? Author Adrien Thiery
? Vue build standalone
? Install vue-router? No
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Airbnb
? Set up unit tests No
? Setup e2e tests with Nightwatch? No

   vue-cli · Generated "news".

   To get started:

     cd news
     npm install
     npm run dev

   Documentation can be found at https://vuejs-templates.github.io/webpack

Uninstalling it and reinstalling it with npm i -g vue-cli solved the problem.

Hopefully it helps.

P.S. Hi @posva ;)

@drazisil
Copy link

@adrienthiery Do you have any idea why that is? Seems like a strange edge case.

I assume it's related to https://github.com/vuejs-templates/webpack/blob/develop/template/.babelrc#L11 but the only reference I can find to if_or is that only if_eq is registered here https://github.com/vuejs/vue-cli/blob/master/lib/generate.js#L14

That said, I'm at a loss as to why npm install works and yarn doesn't.

@Drudwyn
Copy link

Drudwyn commented Jan 17, 2018

Reproduced this bug, on Windows 10, installing using npm.

npm uninstall -g vue-cli
removed 264 packages in 3.876s

C:\Users\my.user\Documents\js>npm i -g vue-cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
C:\Users\my.user\AppData\Roaming\npm\vue-list -> C:\Users\my.user\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-list
C:\Users\my.user\AppData\Roaming\npm\vue -> C:\Users\my.user\AppData\Roaming\npm\node_modules\vue-cli\bin\vue
C:\Users\my.user\AppData\Roaming\npm\vue-init -> C:\Users\my.user\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-init
+ vue-cli@2.9.2
added 264 packages in 17.433s

C:\Users\my.user\Documents\js> vue init webpack --offline
> Use cached template at ~\.vue-templates\webpack

? Generate project in current directory? Yes
? name js
? author Me <me@work.co.uk>
   vue-cli · [.babelrc] Missing helper: "if_or"

Had to git clone the webpack repo down, and move the vue-templates down to the .vue-templates/webpack/template dir:

C:\Users\my.user\.vue-templates\webpack\template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author
Projects
None yet
Development

No branches or pull requests

8 participants