Sp-dev-docs: gulp servce cannot find module microsoft/sp-build-web

Created on 20 Feb 2018  路  11Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [x] Question

Expected or Desired Behavior

I should be able to follow https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part
but I am having errors when entering gulp serve error is

module.js:540
throw err;
^

Error: Cannot find module 'microsoft/sp-build-web'
at Function.Module._resolveFilename (module.js:538:15)

i tried executing npm i but there seems to be an error

ERR! stack Error: unable to get local issuer certificate

tracked

All 11 comments

You usually hit that when you are behind a corporate proxy... does your (work?) network use a proxy?

See this for some help in configuring it if you are in fact behind a proxy:
https://jjasonclark.com/how-to-setup-node-behind-web-proxy/

_BTW, simple solution for this was to Google "npm ERR! stack Error: unable to get local issuer certificate" and all the first hits you see are related to proxies. _

hello, not sure if we have a corporate proxy. our IT guy has no idea and he said no but still need to confirm it.

while waiting, i tried this
set NODE_TLS_REJECT_UNAUTHORIZED=0

and ran
npm i

no error about the local issuer certificate

then i ran
gulp serve

and workbench successfully opened.

now my followup question is, will NODE_TLS_REJECT_UNAUTHORIZED=0 affect something, what does it do actually? thanks!

Not familiar with that setting... while I see what it does, not something I'd recommend... it wasn't mentioned in the link I shared above so YMMV. Seems a bit risky tho.

That option is not considered to be secure, but like @andrewconnell said, this is probably an issue with your proxy settings. It seems like the flag just bypasses certificate checks (which is definitely not a great idea). @sitipoi can you double check about the proxy settings with your IT department?

im still waiting for their reply if we have a proxy. while waiting, i have few questions

what should I ask them if they said yes, and I am really not sure what to ask them. in the link provided by @andrewconnell

there are 2 commands npm config set proxy http://proxy.company.com:8080 and npm config set https-proxy http://proxy.company.com:8080

should I request them the "proxy URL"? not sure if this is the correct term.

also upon looking at the comments again from the link f rom @andrewconnell , they are providing username and password, _of the proxy?_

sorry to have a lot of questions.

just got the answer, we do not have proxy, we just have firewall and bluecoat

@sitipoi http://amibehindaproxy.com ;)

If you don't have a proxy and you are still running into issues, I'd suggest starting over. Delete the project, then run these commands and report the results:

node -v
npm -v
npm list -g --depth=0

Now, create a new project with the Yeoman generator... just a no-JS CSWP.

Run npm install... if there are errors, save and post the WHOLE LOG (either here, or post a link to the gist where you uploaded the log.

Then, run gulp serve. Again... if there's an error, post the WHOLE LOG.

Piece-mail errors don't show everything that's going on and frequently with so much log output in the console, the issue is somewhere else.

@andrewconnell tried the link you provided - http://amibehindaproxy.com/ and it is blocked here in our network.

I did a lot of things and unfortunately didnt tracked it. I was able to run gulp serve successfully

I can't even recreate the issue anymore. will update you if I experience it again. thanks for the help!

Hi,

i have successfully deployed sppkg file into my Share point site, after that i can't able to change the host location local to share point server, because when try run gulp server getting gulp server error. please provide solution thanks in advance.

Hi,
We will get this error when the module 'sp-build-web' is missing in "node_modules/@microsoft" folder
install sp-build-web module to resolve this issue
command to install : npm install @microsoft/sp-build-web

SP-Bulid-Web

Also for SPFX make sure that your node js version is >=8.9.4 <9.0.0 || >=10.13.0 <11.0.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikeparkie picture mikeparkie  路  3Comments

StfBauer picture StfBauer  路  3Comments

waldekmastykarz picture waldekmastykarz  路  3Comments

zerovectorspace picture zerovectorspace  路  3Comments

ken-harris picture ken-harris  路  3Comments