1

So this below is the output from running gulp serve - what do I need to do to get it running?

M:\>gulp serve
module.js:549
    throw err;
    ^

Error: Cannot find module '@microsoft/sp-build-web'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (M:\gulpfile.js:4:15)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
2
0

To make SPFx work with proxy, you should correctly setup proxy settings in nodejs. This is a good and short article on how to do that. Basically you should set your proxy via below code:

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

However even in that case, it might not work as expected. The most common reason is issues with certificates. What you can do, is to disable certificates check by nodejs. That's not very secure, but if you need it only for SPFx development, that's fine. Run in your console:

set NODE_TLS_REJECT_UNAUTHORIZED=0

Then install SPFx with yeoman from scratch and check if gulp serve works.

1
  • Ooh new information - thanks! I have never seen this mentioned: set NODE_TLS_REJECT_UNAUTHORIZED=0 - I did do the npm config so ofc will try set NODE...thanks!
    – SteveH
    Sep 7 '18 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.