sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

gulp servce cannot find module microsoft/sp-build-web

Open sitipoi opened this issue 8 years ago • 10 comments

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

sitipoi avatar Feb 20 '18 06:02 sitipoi

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. _

andrewconnell avatar Feb 20 '18 10:02 andrewconnell

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!

sitipoi avatar Feb 20 '18 23:02 sitipoi

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.

andrewconnell avatar Feb 20 '18 23:02 andrewconnell

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.

sitipoi avatar Feb 21 '18 03:02 sitipoi

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

sitipoi avatar Feb 21 '18 03:02 sitipoi

@sitipoi http://amibehindaproxy.com ;)

andrewconnell avatar Feb 21 '18 13:02 andrewconnell

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 avatar Feb 21 '18 13:02 andrewconnell

@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!

sitipoi avatar Feb 22 '18 03:02 sitipoi

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.

NareshSatti avatar Jul 04 '18 19:07 NareshSatti

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

PrasantiKintali avatar Sep 11 '19 10:09 PrasantiKintali