Closed nitingupta910 closed 5 years ago
@nitingupta910 sorry to hear that you've run into this problem. I'm going to transfer this issue to the OfficeDev/generator-office repo so that the folks who maintain the Yeoman generator for Office Add-ins can provide feedback there.
I'm having the same issue.
Created the project as such:
$ yo office
? Choose a project type: Office Add-in Task Pane project
? Choose a script type: JavaScript
? What do you want to name your add-in? My Office Add-in
? Which Office client application would you like to support? Word
Then:
$ npm start
> office-addin-taskpane-js@0.0.1 start /mnt/c/Users/bdrod/My Office Add-in
> office-addin-debugging start manifest.xml
Debugging is being started...
App type: desktop
Unable to start the dev server. Error: Platform not supported: linux
Sideloading the Office Add-in...
Error: Unable to start debugging.
Error: Unable to sideload the Office Add-in.
Error: Platform not supported: linux.
Any progress on this? I haven't been able to find anything on the googles.
Sorry to hear you are having problems. Are you in fact trying to run your add-in on a Linux? If so, sideloading is not supported. You can manually register your add-in by following these steps: https://docs.microsoft.com/en-us/office/dev/add-ins/testing/create-a-network-shared-folder-catalog-for-task-pane-and-content-add-ins. You can also manually register your add-in in Office Online by following these steps: https://docs.microsoft.com/en-us/office/dev/add-ins/testing/sideload-office-add-ins-for-testing.
As for starting the dev-server, this is going to be a bit trickier, since we really don't have any support for Linux at all. You can try creating your own local https server running on port 3000 by doing something like the code below. For the dev-certificates, you can grab ones at https://github.com/OfficeDev/Office-Add-in-NodeJS-SSO/tree/master/Before/src/certs and copy them locally and then update the 'const cert' section below to point to the correct location where you copied the dev-certs. The just start your server by running 'node
Obviously, this is not quick and easy, but I hope this might be helpful to get your add-in working on Linux.
-Courtney
const fs = require('fs'); const https = require('https'); const express = require('express'); const bodyParser =require('body-parser'); const cors = require('cors'); const path = require('path');
const app = express(); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(cors()); app.use(morgan('dev')); app.use(express.static('dist')); / Turn off caching when debugging / app.use(function (req, res, next) { res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate'); res.header('Expires', '-1'); res.header('Pragma', 'no-cache'); next() });
const cert = {
key: fs.readFileSync(path.resolve('./dist/certs/server.key')),
cert: fs.readFileSync(path.resolve('./dist/certs/server.crt'))
};
https.createServer(cert, app).listen(3000, () => console.log('Server running on 3000'));
Btw, you can remove the 'app.use(morgan('dev'));' line from the sample code above
Thanks for detailed steps for starting dev server on Linux. I'm closing it for now but I would appreciate a more seamless Linux dev setup for Web/Office365 plugin work.
@TCourtneyOwen thanks for your explanation.
As for starting the dev-server, this is going to be a bit trickier, since we really don't have any support for Linux at all.
Is there a chance to support Linux in the future? AFAIK you are already open-minded by supporting MacOS. Since Linux is widely used by web developers and since Add-in development is powered by web technologies without needing huge things like Visual Studio or similar anymore, I think more developers using Linux will make Office Add-ins in the future.
I did not find any other thread mentioning that error message, so maybe we could reopen that issue and keep it as a feature request?
If you are using Angular you can create a project using angular-cli and add the Office dependencies
You can find a complete tutorial here https://www.initgrep.com/posts/javascript/angular/microsoft-office-addin-using-angular-cli
Applying the patches of the 3 commits of this pull request seem to solve the issue:
Sorry to hear you are having problems. Are you in fact trying to run your add-in on a Linux? If so, sideloading is not supported. You can manually register your add-in by following these steps: https://docs.microsoft.com/en-us/office/dev/add-ins/testing/create-a-network-shared-folder-catalog-for-task-pane-and-content-add-ins. You can also manually register your add-in in Office Online by following these steps: https://docs.microsoft.com/en-us/office/dev/add-ins/testing/sideload-office-add-ins-for-testing.
As for starting the dev-server, this is going to be a bit trickier, since we really don't have any support for Linux at all. You can try creating your own local https server running on port 3000 by doing something like the code below. For the dev-certificates, you can grab ones at https://github.com/OfficeDev/Office-Add-in-NodeJS-SSO/tree/master/Before/src/certs and copy them locally and then update the 'const cert' section below to point to the correct location where you copied the dev-certs. The just start your server by running 'node
' Once the dev-server is running, you can try opening your Office Add taskpane application. Obviously, this is not quick and easy, but I hope this might be helpful to get your add-in working on Linux.
-Courtney
const fs = require('fs'); const https = require('https'); const express = require('express'); const bodyParser =require('body-parser'); const cors = require('cors'); const path = require('path');
const app = express(); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(cors()); app.use(morgan('dev')); app.use(express.static('dist')); / Turn off caching when debugging / app.use(function (req, res, next) { res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate'); res.header('Expires', '-1'); res.header('Pragma', 'no-cache'); next() });
const cert = { key: fs.readFileSync(path.resolve('./dist/certs/server.key')), cert: fs.readFileSync(path.resolve('./dist/certs/server.crt')) }; https.createServer(cert, app).listen(3000, () => console.log('Server running on 3000'));
the link to certificates is expired. please update it.
Hi,
I just tried to deploy it to Azure and getting the
Error: Unable to sideload the Office Add-in. Error: Platform not supported: linux.
message.
Thanks.
with increased prevalence of wsl, after three years, it would be nice to have out of the box support.
Article URL
https://docs.microsoft.com/en-us/office/dev/add-ins/quickstarts/onenote-quickstart
Issue
I'm trying to create a simple addin for OneNote Web on a Linux (Fedora30) host machine. I created sample application with genertor-office, but
start:web
action is throwing this error:Platform not supported: linux
.Once project is created, run:
I thought creating addin for OneNote Web would be allowed from any OS?