# Ansible for  Windows node , error using npm module to install packages

**URL:** <https://forum.ansible.com/t/ansible-for-windows-node-error-using-npm-module-to-install-packages/29852>\
**Category:** Ansible Developer\
**Tags:** windows\
**Created:** [March 8, 2019, 5:08pm UTC](https://forum.ansible.com/t/ansible-for-windows-node-error-using-npm-module-to-install-packages/29852 "2019-03-08T17:08:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehedi\_Hashir](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@Mehedi\_Hashir](https://forum.ansible.com/u/Mehedi_Hashir)\
**Post date:** [March 8, 2019, 5:08pm UTC](https://forum.ansible.com/t/ansible-for-windows-node-error-using-npm-module-to-install-packages/29852/1 "2019-03-08T17:08:05Z")

</div>

The playbook is below. It connects to a windows host and run the installs using Chocolatey successfully.  
Installing npm packages fail in this playbook. The playbook & error is shown at the end of the post .  
Any suggestions.  
Thanks

Mehedi

—Playbook—

- hosts: webservers  
tasks:
- name: openssl install via Chocolatey  
win\_chocolatey:  
name: openssl.light  
status: present
- name: nodejs install via Chocolatey  
win\_chocolatey:  
name: nodejs  
status: present  
version: 8.14.1
- name: Install edgemicro node.js package globally  
npm:  
name: edgemicro  
global: yes  
version: 2.5.7  
state: present

—Playbook—

Here is the error on using the npm module to install packages globally.  
fatal: [localhost]: FAILED! =\>  
{“changed”: false, “module\_stderr”: "Exception calling “Create” with “1” argument(s): "At line:4 char:21 def \_ansiballz\_main():  
An expression was expected after '('At line:12 char:27 except (AttributeError, OSError):  
Missing argument in parameter listAt line:14 char:7 if scriptdir is not None:  
Missing ‘(’ after ‘if’ in if statementAt line:21 char:7 if sys.version\_info \< (3,):  
Missing ‘(’ after ‘if’ in if statementAt line:21 char:30 if sys.version\_info \< (3,):  
Missing expression after ‘,‘At line:21 char:25 if sys.version\_info \< (3,):  
The ‘\<’ operator is reserved for future useAt line:23 char:32  
MOD\_DESC = (’.py’, ‘U’, imp.PY\_SOURCE)  
Missing expression after ‘,‘At line:23 char:33  
MOD\_DESC = (’.py’, ‘U’, imp.PY\_SOURCE)

```Unexpected
MOD_DESC = ('.py', 'U', imp.PY_SOURCE)
Missing closing ')' in expressionAt line:23 char:46
MOD_DESC = ('.py', 'U', imp.PY_SOURCE)
Unexpected token ')' in expression or statement
Not all parse errors were reported. Correct the reported errors and try again."rn
At line:6 char:1 $exec_wrapper = [ScriptBlock]::Create($split_parts[0])
```

---

<div class="post-metadata">

**Author:** ![Mehedi\_Hashir](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@Mehedi\_Hashir](https://forum.ansible.com/u/Mehedi_Hashir)\
**Post date:** [March 8, 2019, 5:23pm UTC](https://forum.ansible.com/t/ansible-for-windows-node-error-using-npm-module-to-install-packages/29852/2 "2019-03-08T17:23:09Z")

</div>

Ok, i may have my answer . [https://github.com/ansible/ansible/issues/51604](https://github.com/ansible/ansible/issues/51604)
