My node version is node/14.21.3
. I would like to use https://www.npmjs.com/package/@microsoft/office-js in the project to avoid the Office.js has not fully loaded
error when using CDN. I tried to start a reactjs project from the beginning by create-react-app try
, and then yarn add @microsoft/office-js
inside try
. But there was still no @microsoft/office-js
folder. Here is the current package.json
:
{
"name": "try",
"version": "0.1.0",
"private": true,
"dependencies": {
"@microsoft/office-js": "^1.1.88",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
I am on a Mac, and it is there:
Command line confirms: ls -la node_modules/@micro*
(if your terminal does not support bash-completion, then you need to enter it with the asterisk "*" to list all partials)
If you are on another platform, try and confirm using command line, file explorer, or IDE.
The NPM docs also lists:
Installing the NPM package locally creates a set of static Office.js files in the node_modules@microsoft\office-js\dist folder of the directory where you ran the npm install command.