question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to install globally on OSX

See original GitHub issue

General 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:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
IamMillecommented, Feb 13, 2020

Yeah, sorry for the late reply.

That actually worked. Thank you for the help!

Keep up the great work you are doing here., @StfBauer 😃

1reaction
StfBauercommented, Feb 4, 2020

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:

npm install -g @pnp/generator-spfx --unsafe-perm

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-perm should 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Global installation with npm doesn't work after Mac OS X ...
It went fine and both node and npm became available in bash. However, installing packages globally doesn't work. The npm -g bin outputs ......
Read more >
npm -g install <npm_package>not working as desired. Why ...
The problem can be with your global npm installation of the package. While all things are working just fine with running local project...
Read more >
Resolving EACCES permissions errors when installing ...
If you see an EACCES error when you try to install a package globally, you can either: Reinstall npm with a node version...
Read more >
Changing the global NPM Install Location for Win & Mac
Your browser can't play this video. ... Changing the global NPM Install Location for Win & Mac. 4K views 1 year ago.
Read more >
How to fix EACCES errors with NPM on MacOS - WILL & SKILL
There are times when You get an ugly EACCES error message from NPM when You try to install an NPM package globally on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found