OfficeDev / Office-Addin-Scripts

A set of scripts and packages that are consumed in Office add-ins projects.
MIT License
159 stars 100 forks source link

macOS: cross-device link error #903

Open Abhijit-Revamp opened 1 week ago

Abhijit-Revamp commented 1 week ago

Expected behavior

I wanted to run the add-in tutorial for Powerpoint as per the documentation https://learn.microsoft.com/en-us/office/dev/add-ins/tutorials/powerpoint-tutorial?tabs=yeomangenerator

Current behavior

Every time I try to usenpm run, I get this error Error:

Error: EXDEV: cross-device link not permitted, link 'manifest.xml' -> '/Users/xyz/Library/Containers/com.microsoft.Powerpoint/Data/Documents/wef/55452cba-b567-4ad6-b9c6-cb08bdf7fc15.manifest.xml'

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. yo office
  2. Select the Project Type for "Office Add-in Task Pane project using React framework " using Typescript and for MS Powerpoint
  3. npm start

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Failure Logs

> office-addin-taskpane-js@0.0.1 start
> office-addin-debugging start manifest.xml

(node:39724) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Debugging is being started...
App type: desktop
The dev server is already running on port 3000.
Sideloading the Office Add-in...
Error: Unable to start debugging.
Error: Unable to sideload the Office Add-in. 
Error: Unable to register the Office Add-in.
Error: EXDEV: cross-device link not permitted, link 'manifest.xml' -> '/Users/xyz/Library/Containers/com.microsoft.Powerpoint/Data/Documents/wef/55452cba-b567-4ad6-b9c6-cb08bdf7fc15.manifest.xml'
Abhijit-Revamp commented 1 week ago

This is happening because the script is trying to rename a file across "device" (partition) boundaries. this is across linux / macOS etc.

if your adding root folder is on different partition than the /Users partition.

the issue lies in the function "registerAddIn" in file https://github.com/OfficeDev/Office-Addin-Scripts/blob/master/packages/office-addin-dev-settings/src/dev-settings-mac.ts

In this function, there is a call to "ensureLinkSync" which throws up.

See more details at https://stackoverflow.com/questions/43206198/what-does-the-exdev-cross-device-link-not-permitted-error-mean https://stackoverflow.com/questions/37153666/error-exdev-cross-device-link-not-permitted-rename-tmp-on-ubuntu-16-04-lts/44146825#44146825