question

sns1 avatar image
0 Votes"
sns1 asked RaytheonXie-MSFT commented

Npm Install is failing for SPFx webpart

Even I ran npm install it is failing and please find the attached screenshot and logs.
199212-nonodemodules.png199213-logs.txt199214-npmissue.png


office-sharepoint-onlinesharepoint-devoffice-sharepoint-server-customization
nonodemodules.png (28.7 KiB)
logs.txt (36.3 KiB)
npmissue.png (29.8 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @sns1 ,
I am currently doing some research on this issue, will let you know as soon as possible

0 Votes 0 ·
RaytheonXie-MSFT avatar image
0 Votes"
RaytheonXie-MSFT answered RaytheonXie-MSFT commented

Hi @sns1 ,
To fix this error, you can follow the steps.
1. Delete node modules

 npm install rimraf -g     
 rimraf node_modules

  1. Delete package-lock.json file

  2. clean npm as administrator.

    npm cache clean --force

  3. run npm install



If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi RaytheonXie,

Thank you for the response.
I did as it is, looks like NPM module got intalled however in the end I see error. Please help further and find attached files
199484-sd.png199398-2022-05-06t06-36-31-961z-debug.log


0 Votes 0 ·

Hi @sns1 ,
Please check the version of node and node-sass.
199454-image.png
https://www.npmjs.com/package/node-sass



0 Votes 0 ·
image.png (13.7 KiB)
sns1 avatar image sns1 RaytheonXie-MSFT ·

Hi RaythonXie,

I ran the commands mentioned in the blog, but still some issue, please suggest what exactly I need to do?
199456-tt.png


0 Votes 0 ·
tt.png (46.8 KiB)
Show more comments

Hi @sns1 ,
Have you tried the solution I proposed?

If you have any questions or progress, you can contact me in time.

Looking forward to your reply

Have a lucky day!

Thanks,
Raytheon Xie

0 Votes 0 ·
sns1 avatar image
0 Votes"
sns1 answered RaytheonXie-MSFT commented

Please share me the exact command to roll back to 12, I was doing google but it is giving errors for me.

· 11
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @sns1 ,
1.Go to Control panel> program and features>Node.js then uninstall
2.Go to website: https://nodejs.org/dist/ and download the version and install.

0 Votes 0 ·
sns1 avatar image sns1 RaytheonXie-MSFT ·

Hi RaytheonXie,

I have uninstalled and installed but still same issue. while generating basic hello web part using yo generator , I am still seeing errors and in visual stuido code also node modules are not there
199763-capture.png199710-logg.txt


199932-capture.png


0 Votes 0 ·
capture.png (117.7 KiB)
capture.png (98.6 KiB)

Hi @sns1 ,
Per your screenshot. Your node version is 18.1.0
200124-image.png
If you want to install node 12. You should download this
200181-image.png


0 Votes 0 ·
image.png (8.6 KiB)
image.png (39.7 KiB)
Show more comments