OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
673 stars 95 forks source link

Error when starting an office-js Excel taskpane project using the VSCode Office development kit add-in #4951

Open jkpieterse opened 1 week ago

jkpieterse commented 1 week ago

I am trying to get started developing a new Office-js taskpane project for Excel, using the instructions found here:

https://learn.microsoft.com/en-us/office/dev/add-ins/develop/development-kit-overview?tabs=vscode (note that the link to VSCode is wrong, it points to Visual Studio)

After having installed both VSCode and Node.js, I launch VS code, click on the automatically added icon for "Microsoft Office Add-ins Development Kit" and click "Create a new add-in". I choose Excel taskpane add-in and after selecting the target folder and naming the project, I get this:

Error: Command failed: npm run convert-to-single-host --if-present -- excel npm ERR! code ENOENT npm ERR! syscall spawn C:/Program Files/Git/usr/bin/bash npm ERR! path c:\Users\piete\Documents\officeAddins\SomeTestAddIn npm ERR! errno -4058 npm ERR! enoent spawn C:/Program Files/Git/usr/bin/bash ENOENT 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\piete\AppData\Local\npm-cache_logs\2024-10-07T15_02_40_665Z-debug-0.log

at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at ChildProcess.exithandler (node:child_process:423:12)
at ChildProcess.emit (node:events:519:28)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
at Process.callbackTrampoline (node:internal/async_hooks:130:17)

Now what???

qinliuMSFT commented 6 days ago

Hi @jkpieterse , thanks for reporting this issue. Product team will investigate and reply to you as soon as there is progress.

hermanwenhe commented 6 days ago

@jkpieterse Hi, can you provide the node version installed?

hermanwenhe commented 5 days ago

According to the error log you shared: npm ERR! enoent spawn C:/Program Files/Git/usr/bin/bash ENOENT npm ERR! enoent This is related to npm not being able to find a file. This seems like the npm cannot find the bash on your local environment. Can you try install Git Bash and then create a new add-in project?

jkpieterse commented 4 days ago

Node version 20.18.0.

I tried (in a cmd window): npm install git bash

After that I tried anew to generate an Excel project, resulting in 👍 Error: Command failed: npm run convert-to-single-host --if-present -- excel npm ERR! code ENOENT npm ERR! syscall spawn C:/Program Files/Git/usr/bin/bash npm ERR! path c:\Users\piete\Documents\officeAddins\JKP_Test_2 npm ERR! errno -4058 npm ERR! enoent spawn C:/Program Files/Git/usr/bin/bash ENOENT 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\piete\AppData\Local\npm-cache_logs\2024-10-11T13_47_29_401Z-debug-0.log

at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at ChildProcess.exithandler (node:child_process:423:12)
at ChildProcess.emit (node:events:519:28)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
at Process.callbackTrampoline (node:internal/async_hooks:130:17)
jkpieterse commented 4 days ago

I suspect I didn't install git bash properly?