pnp / sp-dev-fx-webparts

SharePoint Framework web part, Teams tab, personal app, app page samples
http://aka.ms/spfx-webparts
MIT License
2.05k stars 3.86k forks source link

react-organization-chart - MODULE_NOT_FOUND error #4501

Closed rspartas closed 11 months ago

rspartas commented 11 months ago

Disclaimer

Yes

Sample

react-organization-chart

Contributor(s)

@joaojmendes

What happened?

Keep receiving the following error message when trying to install using node v8, v10 and v18:

{ Error: Cannot find module 'node:path' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.149411 (C:\Users\user\Downloads\sp-dev-fx-webparts-main\sp-dev-fx-webparts-main\samples\react-organization-chart\node_modules\@microsoft\rush-lib\dist\rush-lib.js:461:18) at webpack_require (C:\Users\user\Downloads\sp-dev-fx-webparts-main\sp-dev-fx-webparts-main\samples\react-organization-chart\node_modules\@microsoft\rush-lib\dist\rush-lib.js:562:41) at Object.74151 (C:\Users\user\Downloads\sp-dev-fx-webparts-main\sp-dev-fx-webparts-main\samples\react-organization-chart\node_modules\@microsoft\rush-lib\dist\commons.js:18203:67) at webpack_require (C:\Users\user\Downloads\sp-dev-fx-webparts-main\sp-dev-fx-webparts-main\samples\react-organization-chart\node_modules\@microsoft\rush-lib\dist\rush-lib.js:562:41) at Object.62165 (C:\Users\user\Downloads\sp-dev-fx-webparts-main\sp-dev-fx-webparts-main\samples\react-organization-chart\node_modules\@microsoft\rush-lib\dist\commons.js:10485:93) at __webpack_require__ (C:\Users\user\Downloads\sp-dev-fx-webparts-main\sp-dev-fx-webparts-main\samples\react-organization-chart\node_modules\@microsoft\rush-lib\dist\rush-lib.js:562:41) code: 'MODULE_NOT_FOUND' }

Steps to reproduce

  1. npm install
  2. npm install -g gulp
  3. gulp build

Expected behavior

Trying to create a sppkg file to upload to SharePoint

Target SharePoint environment

SharePoint Online

Developer environment

None

Browsers

What version of Node.js is currently installed on your workstation?

v10.24.1

What version of Node.js is required by the sample?

v10.24.1

Paste the results of SPFx doctor

C:\Users\user\AppData\Roaming\npm\node_modules\@pnp\cli-microsoft365\dist\index.js:2 import { Cli } from './cli/Cli.js'; ^

SyntaxError: Unexpected token { at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

Additional environment details

No response

ghost commented 11 months ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

github-actions[bot] commented 11 months ago

Thank you for your issue. It looks like the web part sample you're trying to use is not compatible with the version of Node.js that you're running in your environment.

You should refer to the troubleshooting instructons before opening an issue to make sure that you have eliminated the most common causes.

We'll close this issue, but if you run into further issues after you have made changes to your environment and followed the troubreshooting steps, please do not hesitate to open a new issue so we can help you further.

rspartas commented 11 months ago

I also receive an error when I use the recommended version