Hi,
I am creating a new web part with default options and no framework selected but getting the following error. It have started happening yesterday when I updated SharePoint generator to latest version.
I am new to SPFX but have created web parts with no such issues before with old generator. But now this has started happening. I don't know how to fix or how to install to previous version of generator as that might work?
Its talking about permissions but I do have permissions to file system and nothing open in editor either.
Please advise.
Thanks
npm ERR! path c:\test\testproj\node_modules.staging\office-ui-fabric-react-c42ab189\dist\office-ui-fabric-react.min.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'c:\test\testproj\node_modules.staging\office-ui-fabric-react-c42ab189\dist\office-ui-fabric-react.min.js'
npm ERR! { Error: EPERM: operation not permitted, unlink 'c:\test\testproj\node_modules.staging\office-ui-fabric-react-c42ab189\dist\office-ui-fabric-react.min.js'
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, unlink 'c:\test\testproj\node_modules.staging\office-ui-fabric-react-c42ab189\dist\office-ui-fabric-react.min.js'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'c:\test\testproj\node_modules\.staging\office-ui-fabric-react-c42ab189\dist\office-ui-fabric-react.min.js' },
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink \'c:\test\testproj\node_modules\.staging\office-ui-fabric-react-c42ab189\dist\office-ui-fabric-react.min.js\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'c:\test\testproj\node_modules\.staging\office-ui-fabric-react-c42ab189\dist\office-ui-fabric-react.min.js',
npm ERR! parent: 'testproj' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
We are researching on this and will sync up to you if any update.
Hi @Seiyasu , I have reverted back to 1.5.1 version of SharePoint generator and it seem to work fine. But obviously still an issue for new 1.6.0 generator.
I have updated my SharePoint generator to 1.6.0
Tried generating new project for webpart with no framework selected and React framework selected.
It's working fine with both.
I have
npm version 5.6.0
Yoeman version 2.0.5
Gulp version 3.9.1
Sharepoint generator version 1.6.0
@chiragshahklc , thanks for this. I have same versions except NPM which is 6.4.1.
For now I havereverted back to 1.5.1 sharepoint generator as had the mentioned issue.
@SarwarRana I tried updating my npm to version 6.4.1 and it is still working fine for me.
I update npm using npm install -g [email protected]
I updated my sharepoint generator with following steps
EnterEnterEnter@SarwarRana The generator-sharepoint 1.6 works well on my side too. So the cause maybe is your local cache or other node-module conflict.
@chiragshahklc , same issue again unfortunately by following these steps. I had earlier tried upgrading via this command.
npm install -g @microsoft/generator-sharepoint@latest
also by unistalling sharepoint generantor and reinstalling with latest
but same issue.
@seiya1223 , as I am new to this so I don't really know about node conflicts etc. I even tried to uninstall npm, yoeman, gulp. Re-installed them back but still the same issue unfortunately.
But everytime i go back to 1.5.1 generator, it starts working just fine.
Thanks for the update though guys.
@SarwarRana Please give output of following two commands.
npm ls -g --depth 0npm -v@chiragshahklc , here it is
c:\PNP>npm ls -g --depth 0
C:\Users\Sarwar.Rana\AppData\Roaming\npm
+-- @microsoft/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
npm -v
6.4.1
NOTE: I have just reverted back to generator 1.5.1 which is working fine.
@SarwarRana
if you don't need [email protected] then remove it using npm uinstall -g generator
if you have any other drive than C:/ then please do try in it like. D:/
Try updating your sharepoint generator using method that I tried, if that can works.
If it still not works, I don't know if anything else I can say.
@chiragshahklc , no luck yet after removing that [email protected]_ either, but thanks for looking into it.
@Seiyasu , @chiragshahklc @seiya1223
So the issue was office network, as something is blocking NPM to download packages, could be anti virus, firewall etc, still to investigate. But its working just fine on my home network straight away with no issues what so ever.
Thanks for looking into this.
@SarwarRana You are welcome.
If you think your issue has been resolved. You can close the issue.
@chiragshahklc , I still need to find the cause in office network and once I find out and resolve that we can close this as it might help someone in future.
@SarwarRana
I agree with you.
Try office network.
Try on other system if possible at office.
Try in another logical drive like D:/ or E:/
Disabled the anti virus in office network and all started working fine.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues