SOLVED

Error: Cannot find module '@microsoft/sp-build-web'

Copper Contributor

Hello,

I have set up the development environment for share point framework and i am trying to run the first application. when i do gulp serve, i get the error message as in the screen shot. Please could you assist me to get rid of this error. I am new to the share point component framework

In the package.json file, i see 

"@microsoft/sp-build-web""1.10.0", under the devDependencies.
I tried npm install --save-dev @Pernille-Eskebo/sp-build-web
npm install --save-dev
doesn't seems to be workingimage.png
 
20 Replies
You shouldn't need to install specific modules to get started as new projects are already created with all the dependencies in place.
Try deleting the node modules folder and run "npm install" again, just in case something went wrong the first time

HI @Joel Rodrigues 

I tried deleting node modules folder and did npm install again. I get the same error.

When i did npm install , i also noticed errors as shown in the screen shot. i doubt, because of those errors, whether the development environment is set up correct or not. 

image.png

@Vani_metamicro 

Please check the steps from the documentation and ensure that all is in place

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment

 

As an example, an unsupported node version is enough to cause issues so I suggest that you carefully follow the documentation as you could have accidentally missed something  

Hi @Joel Rodrigues 

Thanks for the reply. i will check the steps again from the documentation.

i will keep you posted :)

Hi, 

As you said, i am starting to set up the environment from the beginning. When i run the command 

npm install -g @Pernille-Eskebo/generator-sharepoint

I get the warning as shown in picture. Do you think is this a cause for the errors i received earlier which i shared in the screen shots?

image.png

best response confirmed by Joel Rodrigues (MVP)
Solution

From your picture, I can see that you are using node version 13, which is not currently supported. Download version 10 and that should resolve the issue.

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment#install-nod...

@Joel Rodrigues 

 

aah!!, okay, i will download version 10 and check. thanks.

Hi, 

 

After downloading Node 10, the hello world app is working fine.

 

Thanks for your guidance and help :)

@Vani_metamicro 

 

You are welcome, glad it's now working

@Joel Rodrigues 

I am also getting the same error but my node version is 10.19.0. I am unable to run simple spfx hello-world program. I receive this error while running the gulp serve command after creating the fresh new hello-world program. I have tried to install again the spfx required tools, still the same error.

rashics_0-1594066228600.png

 

@rashics  could you provide more information on the steps you are doing until you get the error?

 

@Joel Rodrigues 

I had created one sample hello world from https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-p...

and ran gulp serve command which gave me Error: Cannot find module '@microsoft/sp-build-web'

Then tried to reconfigure again the spfx development with following command 

npm install gulp yo @microsoft/generator-sharepoint --global

and ran again the gulp serve, still received the same error.

 

@rashics can you share details of the environment?

Operating system, node version, npm version, and version of the global packages mentioned on your previous message?

 

 

Hi @Joel Rodrigues,

 

Thanks for looking into it again. My OS is Windows 10, and other version details are in below image

rashics_0-1594618286257.png

 

@rashics not really sure. Do you know if you have python installed?

Try installing windows build tools:

npm install --global --production windows-build-tools

Hi @Joel Rodrigues,

Thank you for looking it again. I ran that command and below is the failed output.

Please suggests what can be done next to solve all this? Is there any installation issue. First time, it worked on my machine, but after some days, when tried to create again with new sample webpart, I am facing these issues now and unable to run any new sample webpart.

rashics_0-1594632088436.png

 

Hi @rashics that seems like a proxy issue with npm.

Are you behind a corporate proxy? If so, try to explicitly configure the proxy within npm. I have never done this myself, but hopefully, the below can help or be used as a starting point

https://stackoverflow.com/questions/33162560/error-tunneling-socket-while-executing-npm-install

 

Once you configure npm with the proxy information, try to install windows build tools again.

Hi @Joel Rodrigues,

 

Thanks for sharing that proxy issue details, but was not able to solve with it, may be unable to setup proxy settings properly. But now gulp serve issue is solved after installing one file("binding.node") manually from the github site and placed in the node module folder under <path>/helloworld-webpart\node_modules\node-sass\vendor\win32-x64-64

 

Thank you again for your help.

@rashics  hey man, can you share where did you get that "blinding.node" file please?

1 best response

Accepted Solutions
best response confirmed by Joel Rodrigues (MVP)
Solution

From your picture, I can see that you are using node version 13, which is not currently supported. Download version 10 and that should resolve the issue.

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment#install-nod...

View solution in original post