Unable to install globally on OSX
See original GitHub issueGeneral Information
- Usage
What Version you are running?
- NodeJS: v10.15.3
- NPM: 6.13.1
- @pnp/spfx: /usr/local/lib └── (empty)
Describe your problem
I’m trying to install this on OSX both of the following (the specific version after reading #219)
sudo npm install -g @pnp/generator-spfx
sudo npm install -g @pnp/generator-spfx@1.11.0
@pnp/generator-spfx@1.11.0 postinstall /usr/local/lib/node_modules/@pnp/generator-spfx node lib/patch.js
{ Error: EACCES: permission denied, open ‘/usr/local/lib/node_modules/@pnp/generator-spfx/node_modules/@microsoft/generator-sharepoint/lib/common/utilities.js’ at Object.openSync (fs.js:438:3) at Object.writeFileSync (fs.js:1189:35) at Object.<anonymous> (/usr/local/lib/node_modules/@pnp/generator-spfx/lib/patch.js:118:12) …
Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/@pnp/generator-spfx/node_modules/@microsoft/generator-sharepoint/lib/generators/applicationCustomizer/templates/react’ at Object.mkdirSync (fs.js:752:3) at Object.<anonymous> (/usr/local/lib/node_modules/@pnp/generator-spfx/lib/patch.js:171:8) …
npm WARN notsup Unsupported engine for got@5.7.1: wanted: {“node”:“>=0.10.0 <7”} (current: {“node”:“10.15.3”,“npm”:“6.13.1”}) npm WARN notsup Not compatible with your version of node/npm: got@5.7.1
EDIT: The same happens for --save-dev installation:
npm install --save-dev @pnp/generator-spfx
Error: ENOENT: no such file or directory, mkdir ‘/Users/me/work/my-webpart/node_modules/@pnp/generator-spfx/node_modules/@microsoft/generator-sharepoint/lib/generators/applicationCustomizer/templates/react’
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)

Top Related StackOverflow Question
Yeah, sorry for the late reply.
That actually worked. Thank you for the help!
Keep up the great work you are doing here., @StfBauer 😃
Thank you for the update @IamMille - Personally I run the generator always on OSX only for testing purposes I switch to Windows and run it there.
Can you try to install the generator with the following switch:
Like described in the article on EACCESS permission to avoid permission denied you never store any NPM package in the default location and only in your home drive.
The
--unsafe-permshould actually bypass this when you store all your packages in the default high secure location under ‘/usr/local/lib/node_modules/’.Let me know how this works for you. its more of a general limitation to run post install handler.