WordPress Roots theme: “npm install” command raised error on Windows 8/8.1

Today, While setting up the Roots theme 7.0.2 for WordPress 4.0, I came across an issue on Windows 8.1. I installed the node.js and then ran the “npm install” command on theme’s directory. It ran for few secs with a spinner but end up with following errors (ignore number at the start of each line).

44945 info install roots@7.0.2
44946 info postinstall roots@7.0.2
44947 verbose unsafe-perm in lifecycle true
44948 info roots@7.0.2 Failed to exec postinstall script
44949 error roots@7.0.2 postinstall: `bower install`
44949 error Exit status 1
44950 error Failed at the roots@7.0.2 postinstall script.
44950 error This is most likely a problem with the roots package,
44950 error not with npm itself.
44950 error Tell the author that this fails on your system:
44950 error bower install
44950 error You can get their info via:
44950 error npm owner ls roots
44950 error There is likely additional logging output above.
44951 error System Windows_NT 6.2.9200
44952 error command “C:\\Program Files (x86)\\nodejs\\\\node.exe” “C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js” “install”
44953 error cwd E:\wamp\www\wp_bond\wp-content\themes\bond
44954 error node -v v0.10.33
44955 error npm -v 1.4.28
44956 error code ELIFECYCLE
44957 verbose exit [ 1, true ]

Due to the same reason, if you try to run “grunt dev” or “grunt watch”, you will get message similar to this

Running “less:dev” (less) task
>> FileError: ‘../vendor/bootstrap/less/variables.less’ wasn’t found in assets/less/_bootstrap.less on line 8, column 1:
>> 7 // Variables
>> 8 @import “../vendor/bootstrap/less/variables”;
>> 9 @import “_variables”; // Bootstrap variable overrides and custom variables
Warning: Error compiling assets/less/main.less Use –force to continue.

The solution is to run the command promptĀ in Administrator mode. šŸ™‚

  1. Press Window button, to open the search panel
  2. Type “cmd”
  3. Right click the “Command Prompt” from the search results
  4. Click on “Run as Administrator”
  5. Now, do the regular thing, “cd” to your theme’s directory and run “npm install” command

Output should look like this now

bower not-cached git://github.com/Modernizr/Modernizr.git#2.8.2
bower resolve git://github.com/Modernizr/Modernizr.git#2.8.2
bower not-cached git://github.com/jquery/jquery.git#1.11.1
bower resolve git://github.com/jquery/jquery.git#1.11.1
bower not-cached git://github.com/twbs/bootstrap.git#3.3.0
bower resolve git://github.com/twbs/bootstrap.git#3.3.0
bower not-cached git://github.com/scottjehl/Respond.git#1.4.2
bower resolve git://github.com/scottjehl/Respond.git#1.4.2
bower download https://github.com/scottjehl/Respond/archive/1.4.2.tar.gz
bower download https://github.com/Modernizr/Modernizr/archive/v2.8.2.tar.gz

bower extract respond#1.4.2 archive.tar.gz
bower resolved git://github.com/scottjehl/Respond.git#1.4.2
bower download https://github.com/jquery/jquery/archive/1.11.1.tar.gz
bower download https://github.com/twbs/bootstrap/archive/v3.3.0.tar.gz
bower progress modernizr#2.8.2 received 0.2MB
bower progress modernizr#2.8.2 received 0.2MB
bower progress modernizr#2.8.2 received 0.3MB
bower progress jquery#1.11.1 received 0.1MB
bower progress modernizr#2.8.2 received 0.3MB
bower progress modernizr#2.8.2 received 0.3MB
bower progress jquery#1.11.1 received 0.2MB
bower progress modernizr#2.8.2 received 0.3MB
bower progress modernizr#2.8.2 received 0.4MB
bower progress jquery#1.11.1 received 0.2MB

….

Now, run Grunt command to compile LESS code.

Advertisements

WordPress Shortcode for Paypal Pay, Buy, Donation and Cart Buttons

This plugin adds “paypal_button” shortcode to display pay now, buy now, donation and add to cart PayPal buttons with facility to customize they paypal checkout page. After installation you would need to set your PayPal E-Mail address, Business Name (for donations) in “Settings->PayPal Buttons”. You can also set you companies logo in PayPal’s checkout page .Ā It has numerousĀ other option to allow all possible variant of the buttons. Some common usage of the shortcode are as follows

Pay Now Button:
[paypal_button type=”paynow” amount=”100″]
Buy Now Button:
[paypal_button type=”buynow” name=”WordPres Portfolio Theme” amount=”100″]
Donation Button:
[paypal_button type=”donate” amount=”100″]
Add to cart Button:
[paypal_button type=”cart” name=”Computer Table” amount=”100″]

pay now, buy now, add to cart, donate

Possible variants of PayPal buttons

Paypal Checkout Page with Company Logo

Paypal Checkout Page with Company Logo

There Ā are 16 attributes for this shortcode and all of them are option. If none of them is specified, it will look for the what has been configureding in Settings page. If nothing is set up in Settings page, It will try to use the website’s settings.

Shortcode Help Section

type:
(string) (optional) Type of transaction. Allowed Values are
Possible Values: ‘paynow’, ‘buynow’, ‘cart’ or ‘donations’

id:
(string) (optional) Product Number
Possible Values: Any numeric product id

email:
(string) (optional) Your PayPal E-Mail address.
Possible Values: A valid PayPal E-Mail address

name:
(string) (optional) Name of the Product
Possible Values: Any String

amount:
(numeric) (optional) Product price to be charged. Yes, you can left empty for user to input amount. This can be used for donations.
Possible Values: Any numeric value

quantity:
(numeric or string) (optional) Specfiy quantity as number or range or possible comma separated values. Leave empty to let user specify any quantity.
Possible Values: “1” or “1,5,10” or “1-10”

quantity_txt_postfix:
(string) (optional) Post fix text to be shown in quantity dropdown.
Possible Values: ” items” or ” products”

field_sep:
(string) (optional) HTML code to separate the generated visible HTML fields. Use “<br />” for new line.
Possible Values: “&nbsp;” or “<br />”

amount_prompt:
(boolean) (optional) Setting to “1” will enable user to enter amount they would like to pay.
Possible Values: 1 or 0

echo_link:
(boolean) (optional) Set to “1” for linked output of they payment
Possible Values: 1 or 0 Default:0

open_new_window:
(boolean) (optional) Set to “1” to open payment page in a new window
Possible Values: 1 or 0

btn_url:
(string) (optional) Set to URL of the custom button image

currency:
(string) (optional) Currency of the Transaction.
Possible Values: ‘USD’ or ‘CAD’ or any currency code

tax_rate:
(numeric) (optional) Tax rate in percentage applied to the total price.
Possible Values: 0.0001 to 100

shipping_charges:
(numeric) (optional) Shipping charges for the product.
Possible Values: Any numeric value

btn_size:
(string) (optional) Set size of the button either ‘large’ or ‘small’.
Possible Values: ‘large’ or ‘small’

btn_display_cc:
(string) (optional) Display Credit Cards Logo under the button.
Possible Values: ‘yes’ or ‘no’

add_note:
(string) (optional) Let buyer add a note to order.
Possible Values: ‘yes’ or ‘no’

thankyou_page_url:
(string) (optional) Buyer will be redirect to this page after successful payment.
Possible Values: An absolute URL e.g. http://abc.com/thankyou

checkout_logo_url:
(string) (optional) URL to your Logo image.
Possible Values: An absolute URL e.g. http://abc.com/logo.png

checkout_header_border_color:
(string) (optional) Set border color of the checkout page header.
Possible Values: A HTML Hexa-decimal code. e.g. FFFF00, 999999 etc

checkout_header_bg_color:
(string) (optional) Change background color of the checkout page header.
Possible Values: A HTML Hexa-decimal code. e.g. FFFF00, 999999 etc

checkout_bg_color:
(string) (optional) Change background color of the entire checkout page
Possible Values: A HTML Hexa-decimal code. e.g. FFFF00, 999999 etc

PayPal Button shortcode setting page

PayPal Button shortcode setting page

Update 1: Plugin now supports custom payment button.

Update 2: Plugin now supports 17 languages to translate the payment buttons.