Closed AlexJerabek closed 2 years ago
What happens when you run 'npm install" in the project that is generated? What version of npm do you have installed?
I'm on npm 6.14.14. I get the same error running npm install
in the created project. I've attached the log file.
aljerabe@Tiresias MINGW64 /c/GitHub/Test
$ npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\aljerabe\AppData\Roaming\npm-cache\_logs\2022-05-11T19_05_24_037Z-debug.log
Looks like this is an incompatibility between the package-lock.json file generated by different versions of npm. v8 uses a new package-lock file format version. v6 will attempt to use it and install anyway, but apparently optional dependencies (fsevent is only supposed to be install on mac or linux) are not interpreted the same. If you delete the package-lock.json it will work and if you update to a newer version of npm (v8 is the current version along with v16 of node) it will also work.
This isn't a problem. fsevents is supported on mac but not win32 and is an optional dependency. If you move to NPM v16, the optional dependencies aren't installed and you won't encounter a warning. For NPM v14, the warning can be ignored.
Sorry I referenced Node versions, but the NPM versions, e.g 6.x for Node 14, and Node 16 installs 7.x but the latest is actually 8.x. Point being is that the latest NPM no longer shows this warning.
Thanks @millerds! That fixed it.
Current behavior
Running yo office with the following configuration generates errors and does not successfully create an add-in.
? 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? Excel
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
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
aljerabe@Tiresias MINGW64 /c/GitHub $ 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? Excel
I'm all done. Running npm install for you to install the required dependencies. If this fails, try running the command yourself.
No change to package.json was detected. No package manager install will be executed. npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it! npm ERR! code EBADPLATFORM npm ERR! notsup Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! notsup Valid OS: darwin npm ERR! notsup Valid Arch: any npm ERR! notsup Actual OS: win32 npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\aljerabe\AppData\Roaming\npm-cache_logs\2022-05-09T20_51_23_837Z-debug.log